本文共 1132 字,大约阅读时间需要 3 分钟。
#!/bin/sh## redis Startup script for Redis Server## chkconfig: - 90 10# description: Redis is an open source, advanced key-value store. ## processname: redis-server# config: /etc/redis.conf# pidfile: /var/run/redis_6379.pidPATH=/usr/local/bin:/sbin:/usr/bin:/binREDISPORT=6379EXEC=/usr/local/bin/redis-serverREDIS_CLI=`which redis-cli`PIDFILE=/var/run/redis_${REDISPORT}.pidCONF="/etc/redis.conf"case "$1" in start) if [ -f $PIDFILE ] then echo -n "$PIDFILE exists, process is already running or crashed\n" else echo -n "Starting Redis server...\n" $EXEC $CONF fi ;; stop) if [ ! -f $PIDFILE ] then echo -n "$PIDFILE does not exist, process is not running\n" else PID=$(cat $PIDFILE) echo -n "Stopping ...\n" $REDIS_CLI -p $REDISPORT SHUTDOWN while [ -x ${PIDFILE} ] do echo "Waiting for Redis to shutdown ..." sleep 1 done echo "Redis stopped" fi ;;esac
转载地址:http://wnukx.baihongyu.com/