]> git.saurik.com Git - redis.git/commitdiff
Fix for the init script provided with Redis, thanks to Rowan. This fixes issue 316
authorantirez <antirez@gmail.com>
Thu, 9 Sep 2010 08:24:56 +0000 (10:24 +0200)
committerantirez <antirez@gmail.com>
Thu, 9 Sep 2010 08:24:56 +0000 (10:24 +0200)
utils/redis_init_script

index 35b906fce5060529170bbbcd10a8d6143867f5c3..b1c56002247c9fc9ef80be2b2ce1497f8352f88b 100755 (executable)
@@ -21,15 +21,14 @@ case "$1" in
         then
                 echo -n "$PIDFILE does not exist, process is not running\n"
         else
+               PID=$(cat $PIDFILE)
                 echo -n "Stopping ...\n"
-                echo -n "Sending SHUTDOWN\r\n" | nc localhost $REDISPORT &
-                PID=$(cat $PIDFILE)
+                echo -n "SHUTDOWN\r\n" | nc localhost $REDISPORT &
                 while [ -x /proc/${PIDFILE} ]
                 do
                     echo "Waiting for Redis to shutdown ..."
                     sleep 1
                 done
-                rm $PIDFILE
                 echo "Redis stopped"
         fi
         ;;