From 35ae30e61ad77515f73153bfcc490f6070ef9c85 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Sun, 10 May 2015 21:04:59 +0300 Subject: rhizi.init: stop(): avoid killing all python processes --- res/debian/pkg__rhizi-single/rhizi.init | 5 +++-- res/rz-mux/rhizi-conf-template.d/rhizi.init.jinja | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/res/debian/pkg__rhizi-single/rhizi.init b/res/debian/pkg__rhizi-single/rhizi.init index 758e8625..47cb296d 100644 --- a/res/debian/pkg__rhizi-single/rhizi.init +++ b/res/debian/pkg__rhizi-single/rhizi.init @@ -17,12 +17,13 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="rhizi-server" NAME=rhizi__{{ domain_name }} DAEMON=/usr/bin/python2.7 +RZ_DAEMON=/usr/lib/rhizi/rhizi-server/rz_server.py PIDFILE=/var/run/rhizi/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME USERNAME=www-data GROUPNAME=www-data -ARGS__DAEMON="/usr/lib/rhizi/rhizi-server/rz_server.py --config-dir=/etc/rhizi/mux-conf.d/{{ domain_name }}/" +ARGS__DAEMON="$RZ_DAEMON --config-dir=/etc/rhizi/mux-conf.d/{{ domain_name }}/" ARGS__START_STOP_DAEMON="--make-pidfile --background --chuid ${USERNAME}:${GROUPNAME}" # Exit if the package is not installed @@ -81,7 +82,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/KILL/5 --exec $DAEMON + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --name $RZ_DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. diff --git a/res/rz-mux/rhizi-conf-template.d/rhizi.init.jinja b/res/rz-mux/rhizi-conf-template.d/rhizi.init.jinja index 01e4e2f6..50e35316 100644 --- a/res/rz-mux/rhizi-conf-template.d/rhizi.init.jinja +++ b/res/rz-mux/rhizi-conf-template.d/rhizi.init.jinja @@ -17,12 +17,13 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="rhizi-server" NAME=rhizi__{{ domain_fqdn }} DAEMON=/usr/bin/python2.7 +RZ_DAEMON=/usr/lib/rhizi/rhizi-server/rz_server.py PIDFILE=/var/run/rhizi/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME USERNAME=www-data GROUPNAME=www-data -ARGS__DAEMON="/usr/lib/rhizi/rhizi-server/rz_server.py --config-dir=/etc/rhizi/mux-conf.d/{{ domain_fqdn }}/" +ARGS__DAEMON="$RZ_DAEMON --config-dir=/etc/rhizi/mux-conf.d/{{ domain_fqdn }}/" ARGS__START_STOP_DAEMON="--make-pidfile --background --chuid ${USERNAME}:${GROUPNAME}" # Exit if the package is not installed @@ -81,7 +82,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/KILL/5 --exec $DAEMON + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --name $RZ_DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. -- cgit v1.3.1