Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sample Redis database startup script

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Examples of Redis database startup scripts are as follows:

#! / bin/sh#author:taokey#date:2016-05-06#chkconfig: 345 85 15#description: Redis is a persistent key-value database#processname: redis-server#config: / etc/redis/6379.conf#config: / var/redis#pidfile: / var/redis/run/redis_6379.pid#Source networking configuration.. / etc/sysconfig/network#check that networking is up. ["$NETWORKING" = "no"] & & exit 0rediss = "/ usr/local/bin/redis-server" CLI= "/ usr/local/bin/redis-cli" prog=$ (basename $redis) arog=$ (basename $CLI) REDIS_CONF_FILE= "/ etc/redis/6379.conf" pidfile= "/ var/redis/run/redis_6379.pid" [- f / var/redis] & &. / var/redislockfile=/var/lock/subsys/redisstart () {[- x $redis] | | exit 5 [- f $REDIS_CONF_FILE] | | exit 6 echo $"Starting $prog:" $redis $REDIS_CONF_FILE retval=$? Echo [$retval-eq 0] & & touch $lockfile return $retval} stop () {echo "Stopping $prog:" $CLI shutdown retval=$? If [- f $pidfile] then kill $pidfile retval=$? Else echo "$prog shutdown" > / dev/null 2 > & 1 fi echo [$retval-eq 0] & & rm-f $lockfile return $retval} restart () {stop start} case "$1" in start) start;; stop) stop Restart) restart;; *) echo $"Usage: $0 {start | stop | restart}" exit 2esac

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report