diff options
author | Ben Dowling <ben.m.dowling@gmail.com> | 2014-10-26 11:09:45 -0700 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-12-11 15:21:53 +0100 |
commit | d81c38316bdd1a501a6d225d7c97e1421538e645 (patch) | |
tree | 8206a93402b55b31dfc6fdc39a8430abcf368250 | |
parent | dba57ea910599eb475a8c25bce6dac64590de3ea (diff) | |
download | redis-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-x | utils/redis_init_script.tpl | 5 |
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) |