Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (49 sloc) 1.06 KB
#! /bin/sh
#
# redis-server Persistent key-value db
#
# Author: Ralph Churchill <ralph.churchill@docvia.com>
#
# chkconfig: 2345 98 02
# description: Redis is a high-speed, persistent key-value db.
# processname: redis-server
# pidfile: /var/run/redis-server.pid
# config: /etc/redis.conf
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
REDIS=/usr/local/bin/redis-server
REDIS_ARGS=/etc/redis.conf
[ -f $REDIS ] || exit 0
RETVAL=0
case "$1" in
start)
echo -n "Starting $DESC: "
daemon $NICELEVEL $REDIS $REDIS_ARGS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/redis-server
;;
stop)
echo "Stopping $DESC"
killproc redis-server
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/redis-server
;;
restart|force-reload)
${0} stop
${0} start
RETVAL=$?
;;
status)
status redis-server
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}"
exit 1
;;
esac
exit $RETVAL