redis启动脚本
2017-06-14 12:06
441 查看
#!/bin/sh # # redis init file for starting up the redis daemon # # chkconfig: - 20 80 # description: Starts and stops the redis daemon. # Source function library. . /etc/rc.d/init.d/functions name="redis-server" exec=" /usr/local/bin/$name" pidfile="/var/run/redis.pid" REDIS_CONFIG="/home/ligang/redis-3.0.7/redis.conf" [ -e /etc/sysconfig/redis ] && . /etc/sysconfig/redis lockfile=/var/lock/subsys/redis start() { [ -f $REDIS_CONFIG ] || exit 6 [ -x $exec ] || exit 5 echo -n $"Starting $name: " daemon --user ${REDIS_USER-ligang} "$exec $REDIS_CONFIG" retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $name: " killproc -p $pidfile $name retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { stop start } reload() { false } rh_status() { status -p $pidfile $name } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" exit 2 esac exit $?
相关文章推荐
- Redis集群快速启动脚本程序
- Redis初识:2.通过初始化脚本启动Redis
- 脚本启动redis
- Linux下Redis启动/关闭/重启服务脚本
- Redis数据库启动脚本
- 一个适用于CentOS下的Redis启动脚本
- redis启动脚本
- redis启动管理脚本
- Windows 用bat脚本带配置启动redis,并用vb脚本使其在后台运行。
- redis启动脚本报错
- linux之redis启动脚本编写v1.0
- redis启动脚本
- Redis数据库启动脚本
- redis的启动脚本
- redis配置篇(1)——初识redis,设置初始化脚本,以服务的方式启动
- Linux下Redis启动/关闭/重启服务脚本
- Redis集群_4.redis 启动脚本
- Redis启动脚本
- Redis 3 在CentOS 6.5上安装笔记(含启动脚本)
- shell编写redis启动脚本