#vim /etc/init.d/redis
粘贴以下内容
# chkconfig: 2345 10 90
# description: Start and Stop redis
PATH=/usr/local/bin:/sbin:/usr/bin:/bin
REDISPORT=6379 #实际环境而定
EXEC=/usr/local/redis/bin/redis-server #实际环境而定
REDIS_CLI=/usr/local/redis/bin/redis-cli #实际环境而定
PIDFILE=/var/run/redis.pid
CONF="/usr/local/redis/redis.conf" #实际环境而定
case "$1" in
start)
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed."
else