日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

nginx 服务脚本编写模板

發布時間:2024/4/14 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx 服务脚本编写模板 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
編寫nginx服務腳本:腳本內容如下:[root@www ~]# cat /etc/init.d/nginx #!/bin/bash # nginx Startup script for the Nginx HTTP Server # chkconfig: - 85 15 # pidfile: /usr/local/nginx1.10/logs/nginx.pid # config: /usr/local/nginx1.10/conf/nginx.conf nginxd=/usr/local/nginx1.10/sbin/nginx nginx_config=/usr/local/nginx1.10/conf/nginx.conf nginx_pid=/usr/local/nginx1.10/logs/nginx.pid RETVAL=0 prog="nginx" # Source function library. . /etc/rc.d/init.d/functions # Start nginx daemons functions. start() { if [ -f $nginx_pid ] ; then echo "nginx already running...." exit 1 fi echo -n "Starting $prog: "$nginxd -c ${nginx_config}RETVAL=$? [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx } # Stop nginx daemons functions. stop() { echo -n "Stopping $prog: "$nginxd -s stopRETVAL=$? [ $RETVAL = 0 ] &&rm -f /var/lock/subsys/nginx } # reloadnginx service functions. reload() { echo -n "Reloading $prog: "$nginxd -s reload } # statusngnx service functions status() { if [ -f $nginx_pid ] ; then echo "$prog is running" else echo "$prog is stop" fi } case "$1" in start) start;; stop) stop;; reload) reload;; restart) stop start;; status) status;; *) echo "Usage: $prog {start|stop|restart|reload|status}" exit 1;; esac [root@www ~]# chmod +x /etc/init.d/nginx [root@www ~]# chkconfig --add nginx [root@www ~]# chkconfignginx on [root@www ~]# systemctl daemon-reload

?

轉載于:https://www.cnblogs.com/netsa/p/7028035.html

總結

以上是生活随笔為你收集整理的nginx 服务脚本编写模板的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。