Update redis_init_script.tpl

status command currently reports success when redis has crashed and the pid file still exists. Changing to check the actual process is running.
This commit is contained in:
Ben Dowling 2014-10-26 11:09:45 -07:00
parent 93eed9ae01
commit dab5c09acc
1 changed files with 3 additions and 2 deletions

View File

@ -26,11 +26,12 @@ case "$1" in
fi
;;
status)
if [ ! -f $PIDFILE ]
PID=$(cat $PIDFILE)
if [ ! -x /proc/${PID} ]
then
echo 'Redis is not running'
else
echo "Redis is running ($(<$PIDFILE))"
echo "Redis is running ($PID)"
fi
;;
restart)