Created
June 17, 2013 23:55
-
-
Save anonymous/5801559 to your computer and use it in GitHub Desktop.
script to start and stop redis as daemon - tested on fedora
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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