commit f25f0b19bce75ed89344d53f3602620808d5a9a2
parent ffd6801f5923f89a4de1177875f4545584e1978e
Author: clamiax <smoppy@gmail.com>
Date: Tue, 16 Sep 2014 10:44:33 +0200
Ask for password, if needed. Also preserve environment.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/spawncgi b/spawncgi
@@ -1,4 +1,8 @@
export PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN=5
+
+# Make sure sudo don't complain
+sudo true
+
[ $(pgrep -fl php5 |wc -l) -ne 0 ] && sudo pkill -f php5-cgi
-sudo -u www-data /usr/bin/php5-cgi -b 127.0.0.1:9000 &
+sudo -Eu www-data /usr/bin/php5-cgi -b 127.0.0.1:9000 &