博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux nginx 启动脚本
阅读量:6360 次
发布时间:2019-06-23

本文共 1871 字,大约阅读时间需要 6 分钟。

linux nginx 启动脚本

[root@webtest76 ~]# 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 any errors on this scripts,please contact jackbillow.# and send mail to jackbillow at gmail dot com.## chkconfig: - 85 15# description: Nginx is a high-performance web and proxy server.#              It has a lot of features, but it's not for everyone.# processname: nginx# pidfile: /var/run/nginx.pid# config: /usr/local/nginx/conf/nginx.confnginxd=/usr/local/nginx/sbin/nginxnginx_config=/usr/local/nginx/conf/nginx.confnginx_pid=/var/run/nginx.pidRETVAL=0prog="nginx"# Source function library.. /etc/rc.d/init.d/functions# Source networking configuration.. /etc/sysconfig/network# Check that networking is up.#[ ${NETWORKING} = "no" ] && exit 0[ -x $nginxd ] || exit 0# Start nginx daemons functions.start() {if [ -e $nginx_pid ];then   echo "nginx already running...."   exit 1fi   echo -n $"Starting $prog: "   daemon $nginxd -c ${nginx_config}   RETVAL=$?   echo   [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx   return $RETVAL}# Stop nginx daemons functions.stop() {        echo -n $"Stopping $prog: "        killproc $nginxd        RETVAL=$?        echo        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/run/nginx.pid}# reload nginx service functions.reload() {    echo -n $"Reloading $prog: "    #kill -HUP `cat ${nginx_pid}`    killproc $nginxd -HUP    RETVAL=$?    echo}# See how we were called.case "$1" instart)        start        ;;stop)        stop        ;;reload)        reload        ;;restart)        stop        start        ;;status)        status $prog        RETVAL=$?        ;;*)        echo $"Usage: $prog {start|stop|restart|reload|status|help}"        exit 1esacexit $RETVAL

 

.

转载于:https://www.cnblogs.com/weiok/p/5654209.html

你可能感兴趣的文章
WebSocket跨域问题解决
查看>>
Ubuntu 16.04安装Nginx
查看>>
flutter 教程(一)flutter介绍
查看>>
CSS面试题目及答案
查看>>
Spring自定义注解从入门到精通
查看>>
笔记本触摸板滑动事件导致连滑的解决方式
查看>>
Runtime 学习:消息传递
查看>>
你了解BFC吗?
查看>>
linux ssh tunnel使用
查看>>
十、详解FFplay音视频同步
查看>>
自定义元素探秘及构建可复用组件最佳实践
查看>>
自定义Linux service脚本
查看>>
ICMP
查看>>
CentOS6 手动编译升级 gcc
查看>>
memcached的安装与开启脚本
查看>>
zabbix 邮件报警 -- sendmail
查看>>
JavaScript异步编程
查看>>
tcpdump用法小记
查看>>
Oracle随机函数—dbms_random
查看>>
windows下开发库路径解决方案
查看>>