zoukankan      html  css  js  c++  java
  • redis服务启动脚本

    /etc/rc.d/init.d/redis

    #!/bin/sh
    # chkconfig: 2345 80 90
    # description: Start and Stop redis

    REDISPORT=6379
    EXEC=/ali/redis-3.0.7/src/redis-server
    REDIS_CLI=/ali/redis-3.0.7/src/redis-cli

    PIDFILE=/var/run/redis.pid
    CONF="/ali/redis-3.0.7/redis.conf"
    AUTH="123456"

    case "$1" in
    start)
    if [ -f $PIDFILE ]
    then
    echo "$PIDFILE exists, process is already running or crashed."
    else
    echo "Starting Redis server..."
    $EXEC $CONF
    fi
    if [ "$?"="0" ]
    then
    echo "Redis is running..."
    fi
    ;;
    stop)
    if [ ! -f $PIDFILE ]
    then
    echo "$PIDFILE exists, process is not running."
    else
    PID=$(cat $PIDFILE)
    echo "Stopping..."
    $REDIS_CLI -p $REDISPORT -a $AUTH SHUTDOWN
    sleep 2
    while [ -x $PIDFILE ]
    do
    echo "Waiting for Redis to shutdown..."
    sleep 1
    done
    echo "Redis stopped"
    fi
    ;;
    restart|force-reload)
    ${0} stop
    ${0} start
    ;;
    *)
    echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2
    exit 1
    esac

     

  • 相关阅读:
    对象的方法
    uni-app运行
    flex取值
    阿里矢量库使用
    移动端vue项目模板
    微信分享--转载
    页面流动条
    uni-app打包
    Hibernate~DAO
    EL表达式
  • 原文地址:https://www.cnblogs.com/liqing1009/p/7146357.html
Copyright © 2011-2022 走看看