]> git.saurik.com Git - redis.git/blame - utils/redis_init_script.tpl
new ae.c API to get current events by file descriptor.
[redis.git] / utils / redis_init_script.tpl
CommitLineData
9210e701 1
2case "$1" in
3 start)
4 if [ -f $$PIDFILE ]
5 then
6 echo "$PIDFILE exists, process is already running or crashed"
7 else
8 echo "Starting Redis server..."
9 $EXEC $CONF
10 fi
11 ;;
12 stop)
13 if [ ! -f $PIDFILE ]
14 then
15 echo "$PIDFILE does not exist, process is not running"
16 else
17 PID=$(cat $PIDFILE)
18 echo "Stopping ..."
19 $CLIEXEC -p $REDISPORT shutdown
20 while [ -x /proc/${PID} ]
21 do
22 echo "Waiting for Redis to shutdown ..."
23 sleep 1
24 done
25 echo "Redis stopped"
26 fi
27 ;;
28 *)
29 echo "Please use start or stop as first argument"
30 ;;
31esac