Redis Startup scripts

Source: Internet
Author: User

Writing Redis Startup scripts

[Email protected] etc]# Vi/etc/init.d/redis
[Email protected] etc]# chmod 755/etc/init.d/redis
# ##########################
#chkconfig:  2345 10 90#description: start and stop redispath=/usr/local/bin :/sbin:/usr/bin:/bin   redisport=6379exec=/usr/local/bin/redis-serverredis_cli=/usr/local/bin/ redis-cli   pidfile=/var/run/redis.pidconf= "/etc/redis.conf"    case  "$"  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  does not exist,  Process is not running "else                 pid=$ (cat  $PIDFILE)                  echo  "stopping&nbsp", $REDIS _cli -p  $REDISPORT  shutdown                while [ -x ${pidfile} ]                do                     echo  "waiting for redis  TO SHUTDOWN&NBSP: "                     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 1esac################# #############


This article is from "think one or two" blog, please be sure to keep this source http://250919938.blog.51cto.com/962010/1685632

Redis Startup scripts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.