summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-10-06 18:05:50 +0200
committerErmal <eri@pfsense.org>2014-10-06 18:05:50 +0200
commita3cc8dcc600d105d73eb4729c32433d40d72cab7 (patch)
tree91322dd4fc8973aa44f303ccd4ed8686bd97163c
parent9c2968266996b21bb4e3754ae7ae4d6100970563 (diff)
downloadpfsense-a3cc8dcc600d105d73eb4729c32433d40d72cab7.zip
pfsense-a3cc8dcc600d105d73eb4729c32433d40d72cab7.tar.gz
Add an option to restart php-fpm from console
-rwxr-xr-xetc/rc.initial7
-rwxr-xr-xetc/rc.php-fpm_restart11
2 files changed, 16 insertions, 2 deletions
diff --git a/etc/rc.initial b/etc/rc.initial
index 2277280..deb4d19 100755
--- a/etc/rc.initial
+++ b/etc/rc.initial
@@ -81,7 +81,6 @@ fi
# display a cheap menu
echo ""
-echo ""
echo " 0) Logout (SSH only) 8) Shell"
echo " 1) Assign Interfaces 9) pfTop"
echo " 2) Set interface(s) IP address 10) Filter Logs"
@@ -90,7 +89,8 @@ echo " 4) Reset to factory defaults 12) ${product} Developer Shell"
echo " 5) Reboot system 13) Upgrade from console"
echo " 6) Halt system ${sshd_option}"
echo " 7) Ping host 15) Restore recent configuration"
-echo " ${option98}"
+echo " 17) Restart PHP-FPM "
+echo " ${option98} "
if [ "${option99}" != "" ]; then
/bin/echo "${option99}"
@@ -153,6 +153,9 @@ case ${opmode} in
16)
/etc/rc.banner
;;
+17)
+ /etc/rc.php-fpm_restart
+ ;;
98)
if [ ! -f /tmp/config_moved ]; then
/etc/rc.initial.store_config_to_removable_device
diff --git a/etc/rc.php-fpm_restart b/etc/rc.php-fpm_restart
new file mode 100755
index 0000000..422b951
--- /dev/null
+++ b/etc/rc.php-fpm_restart
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+/bin/pkill -F /var/run/php-fpm.pid
+sleep 2
+
+# Run the php.ini setup file and populate
+# /usr/local/etc/php.ini and /usr/local/lib/php.ini
+/etc/rc.php_ini_setup 2>/tmp/php_errors.txt
+echo ">>> Restarting php-fpm" | /usr/bin/logger -p daemon.info -i -t rc.php-fpm_restart
+/usr/local/sbin/php-fpm -c /usr/local/lib/php.ini -y /usr/local/lib/php-fpm.conf -RD 2>&1 >/dev/null
+
OpenPOWER on IntegriCloud