From d81c38316bdd1a501a6d225d7c97e1421538e645 Mon Sep 17 00:00:00 2001 From: Ben Dowling Date: Sun, 26 Oct 2014 11:09:45 -0700 Subject: [PATCH] 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. --- utils/redis_init_script.tpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/redis_init_script.tpl b/utils/redis_init_script.tpl index d6508631..2e5b6130 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) -- GitLab