From 3b16afcf611a4cb80192222d71e1d1e56939b831 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 10 Nov 2014 18:48:15 +0100 Subject: [PATCH] remove php-fpm from rc scripting and revert back to php-cgi --- etc/inc/system.inc | 24 +++----------- etc/rc | 2 -- etc/rc.initial | 4 --- etc/rc.php-fpm_restart | 11 ------- etc/rc.php_ini_setup | 71 ------------------------------------------ 5 files changed, 5 insertions(+), 107 deletions(-) delete mode 100755 etc/rc.php-fpm_restart diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 3dead2878..e6a9c273d 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -995,9 +995,11 @@ server.errorlog-use-syslog="enable" EOD; } + if ($captive_portal !== false) + $fast_cgi_path = "{$g['tmp_path']}/php-fastcgi-{$captive_portal}.socket"; + else + $fast_cgi_path = "{$g['tmp_path']}/php-fastcgi.socket"; - if ($captive_portal !== false) { - $fast_cgi_path = "{$g['tmp_path']}/php-fastcgi-{$captive_portal}.socket"; $fastcgi_config = << "PHP_FCGI_CHILDREN" => "{$max_php_children}", "PHP_FCGI_MAX_REQUESTS" => "500" ), - "bin-path" => "/usr/local/bin/php" + "bin-path" => "/usr/local/bin/php-cgi" ) ) ) EOD; - } else { - $fast_cgi_path = "{$g['varrun_path']}/php-fpm.socket"; - $fastcgi_config = << - ( "localhost" => - ( - "socket" => "{$fast_cgi_path}", - "broken-scriptfilename" => "enable" - ) - ) -) - -EOD; - } $lighty_config = <</tmp/php_errors.txt -/usr/local/sbin/php-fpm -c /usr/local/lib/php.ini -y /usr/local/lib/php-fpm.conf -RD 2>&1 >/dev/null # Launch external configuration loader for supported platforms if [ "$PLATFORM" = "nanobsd" ]; then @@ -403,7 +402,6 @@ if [ -f /etc/rc.custom_boot_early ]; then echo "Done" fi -export fcgipath=/var/run/php-fpm.socket chmod u+rx /usr/local/opnsense/check_reload_status.py /usr/bin/nice -n20 /usr/local/opnsense/check_reload_status.py sleep 1 # give check_reload_status some time to load to prevent missing socket diff --git a/etc/rc.initial b/etc/rc.initial index deb4d193f..25ee5e4b0 100755 --- a/etc/rc.initial +++ b/etc/rc.initial @@ -89,7 +89,6 @@ 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 " 17) Restart PHP-FPM " echo " ${option98} " if [ "${option99}" != "" ]; then @@ -153,9 +152,6 @@ 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 deleted file mode 100755 index 422b951ec..000000000 --- a/etc/rc.php-fpm_restart +++ /dev/null @@ -1,11 +0,0 @@ -#!/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 - diff --git a/etc/rc.php_ini_setup b/etc/rc.php_ini_setup index ad04f2530..f4b8b9273 100755 --- a/etc/rc.php_ini_setup +++ b/etc/rc.php_ini_setup @@ -303,77 +303,6 @@ suhosin.memory_limit = 512435456 EOF -PHPFPMMAX=3 -if [ $REALMEM -lt 250 ]; then - PHPFPMMAX=2 -elif [ ${REALMEM} -gt 1000 ]; then - PHPFPMMAX=4 -fi - -/bin/cat > /usr/local/lib/php-fpm.conf <> /usr/local/lib/php-fpm.conf <> /usr/local/lib/php-fpm.conf <> /usr/local/lib/php-fpm.conf <