思路:1、判断nginx进程是否存在ps -ef|grep nginx |egrep -v "grep|nginxd.sh"2、case 启动|关闭|重启|重新加载缺陷:nginx分两个不同的进程,分别是master管理进程和运行进程,如果某个进程出现问题的话这个脚本就无效,需要对pid进行流程控制。此脚本没有涉及kill nginx的ID[root@TEST-1 ~]# cat nginxd.s
原创 2017-07-16 14:48:13
1097阅读
# vi /etc/init.d/nginx 写入#!/bin/bash# chkconfig: - 30 21# description: http service.# Source Function Library. /etc/init.d/functio
原创 2014-04-05 21:44:07
422阅读
编写启动脚本以前写的启动脚本都没有颜色,研究了下functions ,functions 是个很好的启动脚本接口文件,最重要的是daemon和killproc2个函数。于是自己跟着写了nginx的#!/bin/bash     #chkconfig:35 23 34   #description: nginx webserver#set
转载 精选 2015-01-16 09:53:12
600阅读
nginx启动脚本问题:在预编译安装nginx时候每次启动时都非常不方便,所以想了下写个nginx脚本在/etc/init.d目录下可实现service的方式启动、停止、重启这样就方便多了! [root@cml init.d]# vim nginxd#!/bin/bash#chkconfig: 2345 20 80prog="nginxd"nginx_bin="/u
原创 2017-09-04 23:22:37
3271阅读
2点赞
2评论
Nginx启动脚本 Nginx ("engine x") 是一个高性能的HTTP和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器。因稳定性、丰富的功能、低资源消耗而闻名。 但Nginx本身不自带启动脚本,需要我们手动编写一份,现在网上所提供的大多数脚本都是有针对行的,可移植性很差。 大多数这样的脚本依赖于系统中functions函数,但该函数仅在个
推荐 原创 2012-07-31 12:21:35
10000+阅读
6点赞
10评论
nginx启动脚本如下:(本文永久地址:http://woymk.blog.51cto.com/10000269/1896533)#!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfi
原创 2017-02-09 23:17:10
1616阅读
#!/bin/bash # chkconfig: - 30 21 # description: http service. # Source Function Library . /etc/init.d/functions # Nginx Settings NGINX
原创 2017-02-20 14:09:13
665阅读
#vim /etc/rc.d/init.d/nginx    #为nginx提供SysV init脚本#!/bin/sh## nginx - this script starts and stops the nginx daemon## chkconfig:   - 85 15 # description:  Nginx is
原创 2017-08-04 16:15:04
690阅读
注意你的nginx版本和存放路径,做相应的改动,亲测在Centos6.7可用
原创 2018-05-24 22:31:11
414阅读
Nginx启动脚本
原创 2019-01-30 18:41:37
735阅读
nginx启动脚本 官方提供地址http://wiki.nginx.org/InitScripts#!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig:   - 85 15 # description:  Nginx is an HTTP(S) s
转载 精选 2015-01-24 11:11:38
464阅读
CODE: #!/bin/sh## nginx - this script starts and stops the nginx daemin## chkconfig:   - 85 15 # description:  Nginx is an HTTP(S) server, HTTP(S) reverse \#     &n
转载 精选 2008-10-28 14:36:39
1967阅读
vi /etc/init.d/nginx 输入下面的脚本的内容   #!/bin/bash # nginx Startup script for the Nginx HTTP Server # this script create it by jackbillow at 2007.10.15. # it is v.0.0.2 version. # if you find a
转载 精选 2010-05-15 22:49:31
659阅读
1、编写脚本,名为nginx    #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig:
原创 2010-10-14 16:49:16
402阅读
1评论
#!/bin/bash##nginx-thisscriptstartsandstopsthenginxdaemin##Bypiaomiao20131003#chkconfig:-8515#description:NginxisanHTTP(S)server.#processname:nginxNGINX=/usr/local/service/nginx/sbin/nginxNGINXPID=/va
原创 2013-10-03 10:09:51
383阅读
#!/bin/bash# chkconfig: - 30 21# description: http service.# Source Function Library. /etc/init.d/functions# Nginx SettingsNGINX_SBIN="/usr/local/nginx/sbin/nginx"NGINX_CONF="/usr/local/nginx/conf/ngi
原创 2015-05-11 22:14:52
381阅读
#!/bin/bash # nginx Startup script for the Nginx HTTP Server # this script create it by jackbillow at 2007.10.15. # it is v.0.0.2 version. # if you find any errors on this scripts,please contact jackb
原创 2015-05-16 23:52:20
477阅读
#!/bin/sh## nginx - this script starts and stops the nginx daemin## chkconfig:   - 85 15 # description:  Nginx is an HTTP(S) server, HTTP(S) reverse \#     &nbs
原创 2015-06-30 16:15:08
783阅读
参考:http://www.01happy.com/centos-nginx-shell-chkconfig/在安装完nginx后,重新启动需要“kill -HUP nginx进程编号”来进行重新加载,显然十分不方便。如果能像apache一样,直接通过脚本进行管理就方便多了。nginx官方早就想好了,也提供了这个脚本,地址:http://wiki.nginx.org/RedHatNginxInit
转载 精选 2015-09-09 15:30:10
611阅读
#!/bin/bash# chkconfig: - 85 15# description: The Nginx HTTP Server is an efficient and extensible  \#              server implementing the current HTTP standar
原创 2015-09-17 09:34:08
357阅读
  • 1
  • 2
  • 3
  • 4
  • 5