1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Merge pull request #1650 from adam101/fix_pid_check

fix(jungle): change pid existence check's condition branches
This commit is contained in:
Evan Phoenix 2019-02-19 17:14:40 -08:00 committed by GitHub
commit 4ea9302835
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,11 +47,11 @@ do_start_one() {
PIDFILE=$1/tmp/puma/pid
if [ -e $PIDFILE ]; then
PID=`cat $PIDFILE`
# If the puma isn't running, run it, otherwise restart it.
# If the puma is running, restart it, otherwise run it.
if ps -p $PID > /dev/null; then
do_start_one_do $1
else
do_restart_one $1
else
do_start_one_do $1
fi
else
do_start_one_do $1
@ -106,8 +106,6 @@ do_stop_one() {
if [ -e $PIDFILE ]; then
PID=`cat $PIDFILE`
if ps -p $PID > /dev/null; then
log_daemon_msg "---> Puma $1 isn't running."
else
log_daemon_msg "---> About to kill PID `cat $PIDFILE`"
if [ "$USE_LOCAL_BUNDLE" -eq 1 ]; then
cd $1 && bundle exec pumactl --state $STATEFILE stop
@ -116,6 +114,8 @@ do_stop_one() {
fi
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE $STATEFILE
else
log_daemon_msg "---> Puma $1 isn't running."
fi
else
log_daemon_msg "---> No puma here..."