From a2b74ffba2ec852a7f060678ccd9551fa1908a31 Mon Sep 17 00:00:00 2001 From: Juergen Daubert Date: Fri, 20 Feb 2015 12:07:33 +0100 Subject: [PATCH] php-fcgi: update to 5.5.22, improved rc script --- php-fcgi/.md5sum | 4 ++-- php-fcgi/Pkgfile | 2 +- php-fcgi/php-fcgi | 21 ++++++++++++++++----- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/php-fcgi/.md5sum b/php-fcgi/.md5sum index 4e754e5b0..241347085 100644 --- a/php-fcgi/.md5sum +++ b/php-fcgi/.md5sum @@ -1,2 +1,2 @@ -79664ce44f7c93f355a25a3fe3dcc91b php-5.5.21.tar.xz -6297748058441ee6c6b88e429ee54ba1 php-fcgi +fb1704131d495f5b3e6ab3b087a8dbe6 php-5.5.22.tar.xz +94a2d91ea488161f10b097db3a4623fd php-fcgi diff --git a/php-fcgi/Pkgfile b/php-fcgi/Pkgfile index 8ebfbe8b4..59eedabdd 100644 --- a/php-fcgi/Pkgfile +++ b/php-fcgi/Pkgfile @@ -4,7 +4,7 @@ # Depends on: xz libpcre libxml2 name=php-fcgi -version=5.5.21 +version=5.5.22 release=1 source=(http://php.net/distributions/php-$version.tar.xz php-fcgi) diff --git a/php-fcgi/php-fcgi b/php-fcgi/php-fcgi index 175366f78..1a8f136a5 100644 --- a/php-fcgi/php-fcgi +++ b/php-fcgi/php-fcgi @@ -3,27 +3,38 @@ # /etc/rc.d/php-fcgi: start/stop FastCGI php daemon # -PHP=/usr/bin/php-cgi +SSD=/sbin/start-stop-daemon +PROG=/usr/bin/php-cgi +PID=/var/run/php-fcgi.pid PORT="127.0.0.1:8000" #PORT="/tmp/php_fcgi.sock" +OPTS="-b $PORT" USR=www COUNT=8 case $1 in start) export PHP_FCGI_CHILDREN=$COUNT - su -s "/bin/sh" $USR -c "$PHP -b $PORT" & + $SSD --start -bm --chuid $USR --pidfile $PID --exec $PROG -- $OPTS ;; stop) - killall -q $PHP + $SSD --stop --remove-pidfile --retry 10 --pidfile $PID ;; restart) $0 stop - sleep 2 $0 start ;; +status) + $SSD --status --pidfile $PID + case $? in + 0) echo "$PROG is running" ;; + 1) echo "$PROG is not running but the pid file $PID exists" ;; + 3) echo "$PROG is not running" ;; + 4) echo "Unable to determine the program status" ;; + esac + ;; *) - echo "usage: $0 [start|stop|restart]" + echo "usage: $0 [start|stop|restart|reload|status]" ;; esac