add notification for existing pidfile
The zuul.init and zuul-merger.init puppet module files did not check if pidfiles existed when starting both services. The pidfile's might exist in the event that the zuul-server and merger were killed, which doesn't clean them up. This change checks for whether those files exist and notifies the user to run the stop command which will clean up any residual pid files. Change-Id: Ie65fdf372f1710ab0c32d03f6b359e1860f566db
This commit is contained in:
parent
81c73e23a2
commit
b03adc90a8
@ -42,10 +42,14 @@ do_start()
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
# 3 if pid file already exist
|
||||
|
||||
mkdir -p /var/run/$NAME
|
||||
chown $USER /var/run/$NAME
|
||||
ulimit -n 8192
|
||||
if [ -f $PIDFILE ]; then
|
||||
return 3
|
||||
fi
|
||||
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 -- \
|
||||
@ -93,6 +97,7 @@ case "$1" in
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
3) echo "Pidfile at $PIDFILE already exists, run service zuul-merger stop to clean up."
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
|
@ -42,10 +42,14 @@ do_start()
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
# 3 if pid file exits already
|
||||
|
||||
mkdir -p /var/run/$NAME
|
||||
chown $USER /var/run/$NAME
|
||||
ulimit -n 8192
|
||||
if [ -f $PIDFILE ]; then
|
||||
return 3
|
||||
fi
|
||||
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 -- \
|
||||
@ -118,6 +122,7 @@ case "$1" in
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
3) echo "Pidfile at $PIDFILE already exists, run service zuul stop to clean up." ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
|
Loading…
x
Reference in New Issue
Block a user