4 PHPSLOT=${SVCNAME#php-fpm-}
5 [ ${PHPSLOT} = 'php-fpm' ] && PHPSLOT="$(eselect php show fpm)"
7 PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf"
8 PHP_FPM_PID="/var/run/php-fpm-${PHPSLOT}.pid"
11 extra_commands="depend"
12 extra_started_commands="reload"
16 use apache2 lighttpd nginx
20 ebegin "Starting PHP FastCGI Process Manager"
22 start-stop-daemon --start --pidfile ${PHP_FPM_PID} --exec \
23 /usr/lib/${PHPSLOT}/bin/php-fpm -- -y "${PHP_FPM_CONF}" -g "${PHP_FPM_PID}"
26 while [ ! -f ${PHP_FPM_PID} ] && [ $i -le $timeout ]; do
36 ebegin "Stopping PHP FastCGI Process Manager"
38 start-stop-daemon --signal QUIT --stop --exec /usr/lib/${PHPSLOT}/bin/php-fpm --pidfile ${PHP_FPM_PID}
43 ebegin "Reloading PHP FastCGI Process Manager"
45 [ -f ${PHP_FPM_PID} ] && kill -USR2 $(cat ${PHP_FPM_PID})