Fix init script for luigid, so it can stop daemon

This commit is contained in:
Lance Edgar 2018-05-30 19:07:21 -05:00
parent dff44209d8
commit 85bcf57534

View file

@ -32,6 +32,7 @@ NAME=${NAME:-"rattail-luigid"}
SCRIPTNAME=${SCRIPTNAME:-"/etc/init.d/$NAME"} SCRIPTNAME=${SCRIPTNAME:-"/etc/init.d/$NAME"}
DESC=${DESC:-"Luigi Scheduler for Rattail"} DESC=${DESC:-"Luigi Scheduler for Rattail"}
DAEMON=${DAEMON:-"/usr/local/bin/luigid"} DAEMON=${DAEMON:-"/usr/local/bin/luigid"}
PYTHON=${PYTHON:-"/usr/local/bin/python"}
USER=${USER:-"rattail"} USER=${USER:-"rattail"}
GROUP=${GROUP:-"rattail"} GROUP=${GROUP:-"rattail"}
PIDFILE=${PIDFILE:-"/var/run/rattail/$NAME.pid"} PIDFILE=${PIDFILE:-"/var/run/rattail/$NAME.pid"}
@ -72,9 +73,9 @@ do_start() {
# other if a failure occurred # other if a failure occurred
do_stop() do_stop()
{ {
start-stop-daemon --test --stop --exec $DAEMON --user $USER --pidfile $PIDFILE --quiet > /dev/null \ start-stop-daemon --test --stop --exec $PYTHON --user $USER --pidfile $PIDFILE --quiet > /dev/null \
|| return 1 || return 1
start-stop-daemon --stop --exec $DAEMON --user $USER --pidfile $PIDFILE --quiet > /dev/null \ start-stop-daemon --stop --exec $PYTHON --user $USER --pidfile $PIDFILE --quiet > /dev/null \
|| return 2 || return 2
} }