#!/bin/bash
# chkconfig: 2345 58 74
# description: nginx web server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/log/nginx.pid
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
if [ -f /etc/sysconfig/nginx ];then
. /etc/sysconfig/nginx
fi
RETVAL=0
prog=”nginx”
start() {
# Check that networking is up.
[ “$NETWORKING” = “no” ] && exit 1
echo -n $”Starting $prog: ”
daemon /usr/local/nginx/sbin/nginx $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/nginx
return $RETVAL
}
stop() {
echo -n $”Shutting down $prog: ”
killproc /usr/local/nginx/sbin/nginx
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/nginx
return $RETVAL
}# See how we were called.
case “$1″ in
start)
start
;;
stop)
stop
;;
status)
status nginx
RETVAL=$?
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/nginx ]; then
stop
start
RETVAL=$?
fi
;;
*)
echo $”Usage: $0 {start|stop|restart|condrestart|status}”
RETVAL=3
esac
exit $RETVAL
Nginx作为Linux系统服务启动
转载请注明出处:服务器评测 » Nginx作为Linux系统服务启动
相关推荐
- RHEL6下NFS启动报错clnt_create:RPC:Unknown host
- 锐速(ServerSpeeder/LotServer)配置参数简单说明,合理修改配置 提高加速效果(逗比大佬)
- Centos7使用GPT格式挂载分区,Centos7如何挂载超过2T硬盘分区的方法
- Centos7如何查看RAID,管理阵列卡。MegaCli命令使用详解
- Centos7.X 一键搭建socks5命令,一句话命令, 搭建sk5与http 代理 Centos7.0 7.6 7.8 7.9
- CentOS6 7 8 ,BBR原版/BBR魔改/BBR Plus/锐速的改善网络拥塞的一键脚本,Debain9,Debain10
- centos 7如何挂载磁盘 linux 7.6挂载磁盘实战教程CentOS 6 7 8 挂载磁盘到/www /home目录
- Centos7 如何关闭防火墙配置 7.6 7.2 7.3 7.8 检测开启重启防火墙添加放行端口