3 # redis init file for starting up the redis daemon
7 # description: Starts and stops the redis daemon.
8 # processname: redis-server
12 # Source function library
13 . /etc/rc.d/init.d/functions
16 . /etc/sysconfig/network
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
21 msg_network_down "Redis"
28 REDIS_CONFIG="/etc/redis.conf"
31 # Get service config - may override defaults
32 [ -f /etc/sysconfig/redis ] && . /etc/sysconfig/redis
34 pidfile="/var/run/redis/redis.pid"
37 # Check if the service is already running?
38 if [ -f /var/lock/subsys/redis ]; then
39 msg_already_running "Redis"
44 daemon --user ${REDIS_USER:-redis} /usr/sbin/redis $REDIS_CONFIG
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/redis
50 if [ ! -f /var/lock/subsys/redis ]; then
51 msg_not_running "Redis"
57 killproc --pidfile $pidfile redis-server -TERM
58 rm -f /var/lock/subsys/redis
62 if [ ! -f /var/lock/subsys/redis ]; then
63 msg_not_running "Redis"
73 # See how we were called.
92 status --pidfile $pidfile redis redis-server
96 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"