码迷,mamicode.com
首页 > 其他好文 > 详细

nginx_system_service.sh

时间:2019-07-17 00:33:30      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:nginx   color   oca   ||   bsp   running   rest   kconfig   load   

 1 #!/bin/bash
 2 #chkconfig: - 85 15
 3 #by zhangjia
 4 #2019年2月20日11:53:25
 5 #shell_name:nginx_system_service.shell_name
 6 #install nignx system service
 7 ######################################################
 8 set -e
 9 PATH="/usr/local/nginx"
10 DESC="nginx daemon"
11 NAME="nginx"
12 CONFIG_FILE=${PATH}/config/${NAME}.conf
13 DAEMON=${PATH}/sbin/${NAME}
14 PIDFILE=${PATH}/logs/${NAME}.pid
15 SCRIPTNAME=/etc/init.d/${NAME}
16 [ -x ${DAEMON} ] || exit 0
17 do_start() {
18     
19     ${DAEMON} -c ${CONFIG_FILE} || echo -n "nginx already running"
20 }
21 
22 do_stop() {
23     ${DAEMON} -s stop || echo -n "nginx is not running"
24 }
25 
26 do_reload() {
27     ${DAEMON} -s reload || echo -n "nginx can not  reload"
28 }
29 
30 case $1 in 
31     start)
32     do_start
33     echo "."
34     ;;
35     
36     stop)
37     do_stop
38     ;;
39     
40     reload)
41     do_reload
42     ;;
43     
44     restart)
45     do_stop
46     do_start
47     ;;
48     *)
49     echo -e "please enter \"start | stop | restart | reload \"";;
50 esac
51     

 

nginx_system_service.sh

标签:nginx   color   oca   ||   bsp   running   rest   kconfig   load   

原文地址:https://www.cnblogs.com/zhj5551/p/11198349.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!