From e03ffd0104acd64a541b65a45058cda3f0e9c601 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 16 Mar 2016 12:14:13 -0500 Subject: [PATCH] Fixes #94: PHP-FPM init script for build from source causes 30s delay when stopping via systemd. --- templates/fpm-init.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/fpm-init.j2 b/templates/fpm-init.j2 index ae95557..4d6a6d5 100644 --- a/templates/fpm-init.j2 +++ b/templates/fpm-init.j2 @@ -17,7 +17,7 @@ NAME={{ php_fpm_daemon }} DAEMON=/usr/sbin/$NAME DAEMON_ARGS="--daemonize --fpm-config {{ php_fpm_conf_path }}/php-fpm.conf" PIDFILE=/var/run/{{ php_fpm_daemon }}.pid -TIMEOUT=30 +TIMEOUT=2 SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed @@ -85,7 +85,7 @@ do_stop() # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/TERM/5/KILL/5 --exec $DAEMON + start-stop-daemon --stop --quiet --oknodo --retry=0/$TIMEOUT/TERM/5/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE