Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2013 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5801559 to your computer and use it in GitHub Desktop.
Save anonymous/5801559 to your computer and use it in GitHub Desktop.
script to start and stop redis as daemon - tested on fedora
#!/bin/sh
#
# script to start and stop redis as daemon
#
# chkconfig: - 85 15
# description: redis is a non-relational database storage system.
# processname: redis
# config: /opt/redis/redis.conf
# binary: /opt/redis/redis-server
PATH=/opt/redis:/sbin:/bin:/usr/sbin:/usr/bin
NAME=redis
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "Starting Redis... "
su - redis -c "/opt/redis/redis-server /opt/redis/redis.conf"
;;
stop)
echo -n "Stopping Redis"
killall /opt/redis/redis-server
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment