[root@localhost]# vim /etc/rc.d/init.d/redis
把如下內容放入
restart(){ echo -e "Restarting $DESC: $PROGNAME" stop start}list(){ ps aux | grep $PROGNAME}case $1 in start) start ;; stop) stop ;; restart) restart ;; list) list ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|list}" >&2 exit 1 ;;esacexit 0
之後可以向服務一樣去操作
service redis restart
http://xxxxxx/Linuxjc/1134242.html TechArticle