Redis Service startup Shutdown script

Source: Internet
Author: User
Tags redis server

The code is as follows:

# Chkconfig:234590 10# Description:service of Redis for start and stop add by Tomener PATH=/usr/local/bin:/sbin:/usr/bin:/Binredisport=6379EXEC=/usr/local/redis/bin/redis-serverredis_cli=/usr/local/redis/bin/redis-CLI Pidfile=/var/run/redis.pid CONF="/usr/local/redis/redis.conf"AUTH="1234" Case " $" inchstart)if[ -F $PIDFILE] Then                           Echo "$PIDFILE exists, process is already running or crashed."                  Else                          Echo "starting Redis Server ..."$EXEC $CONFfi                   if["$?"="0" ]                    Then                           Echo "Redis is running ..."                  fi                   ;; Stop)if[ ! -F $PIDFILE] Then                           Echo "$PIDFILE exists, process is not running."                  ElsePID=$(Cat$PIDFILE)Echo "stopping ..."$REDIS _cli-P $REDISPORT SHUTDOWNSleep 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}">&2Exit1  Esac

Redis Service startup Shutdown script

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.