Fix up some PID issues with init.d scripts

Make sure we use -p $PIDFILE for nodepool services, so we can run more
then 1 of them.

Also pass the PIDFILE to status_of_proc, again to make sure we are
looking at the right process.

Change-Id: I865b763b207f07e75244e80ad84771d81eeac0f4
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-11-25 17:50:19 -05:00
parent 0b6be488ba
commit 195cafd40d
4 changed files with 8 additions and 11 deletions

View File

@ -49,7 +49,7 @@ do_start()
start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER \
--exec $DAEMON --test > /dev/null || return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER \
--exec $DAEMON -- $ARGS || return 2
--exec $DAEMON -- $ARGS -p $PIDFILE || return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
@ -128,7 +128,7 @@ case "$1" in
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $?
;;
reload|force-reload)
#

View File

@ -46,11 +46,10 @@ do_start()
# 2 if daemon could not be started
mkdir -p /var/run/$NAME
chown $USER /var/run/$NAME
chown $USER /var/run/$NAME
start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER \
--exec $DAEMON --test > /dev/null || return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER \
--exec $DAEMON -- $ARGS || return 2
--exec $DAEMON -- $ARGS -p $PIDFILE || return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
@ -129,7 +128,7 @@ case "$1" in
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $?
;;
reload|force-reload)
#

View File

@ -46,11 +46,10 @@ do_start()
# 2 if daemon could not be started
mkdir -p /var/run/$NAME
chown $USER /var/run/$NAME
chown $USER /var/run/$NAME
start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER \
--exec $DAEMON --test > /dev/null || return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER \
--exec $DAEMON -- $ARGS || return 2
--exec $DAEMON -- $ARGS -p $PIDFILE || return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
@ -129,7 +128,7 @@ case "$1" in
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $?
;;
reload|force-reload)
#

View File

@ -46,11 +46,10 @@ do_start()
# 2 if daemon could not be started
mkdir -p /var/run/$NAME
chown $USER /var/run/$NAME
chown $USER /var/run/$NAME
start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER \
--exec $DAEMON --test > /dev/null || return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER \
--exec $DAEMON -- $ARGS || return 2
--exec $DAEMON -- $ARGS -p $PIDFILE || return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
@ -129,7 +128,7 @@ case "$1" in
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $?
;;
reload|force-reload)
#