summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Dowling <ben.m.dowling@gmail.com>2014-10-26 11:09:45 -0700
committerantirez <antirez@gmail.com>2014-12-11 15:21:53 +0100
commitd81c38316bdd1a501a6d225d7c97e1421538e645 (patch)
tree8206a93402b55b31dfc6fdc39a8430abcf368250
parentdba57ea910599eb475a8c25bce6dac64590de3ea (diff)
downloadredis-d81c38316bdd1a501a6d225d7c97e1421538e645.tar.gz
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.
-rwxr-xr-xutils/redis_init_script.tpl5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/redis_init_script.tpl b/utils/redis_init_script.tpl
index d65086312..2e5b61301 100755
--- a/utils/redis_init_script.tpl
+++ b/utils/redis_init_script.tpl
@@ -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)