nginx启动脚本,手动编辑

#! /bin/bash
# chkconfig: -
# description: nginx service XDIR=/www/server/nginx
DESC="nginx daemon"
NAME=nginx
DAEMON=$XDIR/sbin/$NAME
CONFIGFILE=$XDIR/conf/$NAME.conf
PIDFILE=$XDIR/logs/$NAME.pid
SCRIPTNAME=$ Xok='[\033[32m确定\033[0m]'
Xno='[\033[33m失败\033[0m]'
Xsb='[\033[31m失败\033[0m]' do_start() {
[ -e $PIDFILE ] && {
echo -e "$NAME already running " $Xno
} || {
$DAEMON -c $CONFIGFILE
echo -e "Starting $NAME " $Xok
}
} do_stop() {
[ -e $PIDFILE ] && {
$DAEMON -s stop
rm -f $PIDFILE
echo -e "Stopping $NAME " $Xok
sleep
} || {
echo -e "$NAME not running" $Xsb
}
} do_reload() {
[ -e $PIDFILE ] && {
$DAEMON -s reload
echo -e "$NAME reload " $Xok
} || {
echo -e "$NAME not running" $Xsb
}
} configtest(){
$DAEMON -t -c $CONFIGFILE || echo -n "config can't test"
} case "$1" in
"start")
do_start
;;
"stop")
do_stop
;;
r|reload|graceful)
do_reload
;;
"restart")
do_stop
do_start
;;
t)
echo "$NAME: check config"
configtest
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|reload|restart|t}" >&
exit
;;
esac
exit

nginx启动脚本,手动编辑的更多相关文章

  1. LNMP 1.4 nginx启动脚本和配置文件

    编写Nginx启动脚本,写入下面这段,授权755 vim /etc/init.d/nginx #!/bin/bash # chkconfig: - # description: http servic ...

  2. linux nginx 启动脚本

    linux nginx 启动脚本 [root@webtest76 ~]# vi /etc/init.d/nginx #!/bin/bash # nginx Startup script for the ...

  3. Nginx 启动脚本/重启脚本

    第一步先运行命令关闭nginx sudo kill `cat /usr/local/nginx/logs/nginx.pid` 第二步 vi /etc/init.d/nginx 输入以下内容 #!/b ...

  4. centos LNMP第一部分环境搭建 LAMP LNMP安装先后顺序 php安装 安装nginx 编写nginx启动脚本 懒汉模式 mv /usr/php/{p.conf.default,p.conf} php运行方式SAPI介绍 第二十三节课

    centos  LNMP第一部分环境搭建 LAMP安装先后顺序  LNMP安装先后顺序 php安装 安装nginx  编写nginx启动脚本   懒汉模式  mv   /usr/local/php/{ ...

  5. Nginx 启动脚本

    Nginx 启动脚本 1.vim /etc/init.d/nginx #!/bin/bash # chkconfig: - 30 21 # description: http service. # S ...

  6. shell脚本之nginx启动脚本、统计日志字段、for循环实战、跳板机

    1.NGINX启动脚本 #!/bin/bash # chkconfig: 235 32 62 # description: nginx [ -f /etc/init.d/functions ] &am ...

  7. nginx启动脚本和配置文件

    1.编写Nginx启动脚本,并加入系统服务 vim /etc/init.d/nginx并在其中写入如下内容:#!/bin/bash# chkconfig: - 30 21# description: ...

  8. 开发nginx启动脚本及开机自启管理(case)

    往往我们在工作中需要自行写一些脚本来管理服务,一旦服务异常或宕机等问题,脚本无法自行管理,当然我们可以写定时任务或将需要管理的脚本加入自启等方法来避免这种尴尬的事情,case适用与写启动脚本,下面给大 ...

  9. nginx启动脚本(class练习)

    说明:使用类的方式编写程序启动脚本(练习) 1 #!/usr/bin/env python import sys import os from subprocess import Popen,PIPE ...

随机推荐

  1. Python 的装饰器

    Python 在语言级别提供了装饰器模式的实现,代码中Python内置的 functools.wraps 会完成包括函数名属性处理替换 #!/usr/bin/env python3 #--coding ...

  2. js math对象总结

    1:  Math 对象用于执行数学任务. 2:Math 对象并不像 Date 和 String 那样是对象的类,因此没有构造函数 Math(), Math.sin() 这样的函数只是函数 3:通过把 ...

  3. LeetCode 665. Non-decreasing Array (不递减数组)

    Given an array with n integers, your task is to check if it could become non-decreasing by modifying ...

  4. Leetcode题解(28)

    90. Subsets II 题目 分析:代码如下 class Solution { public: vector<vector<int> > subsetsWithDup(v ...

  5. Problem K

    Problem Description The local toy store sells small fingerpainting kits with between three and twelv ...

  6. 模拟制作网易云音乐(AudioContext)

    记得好早前在慕课网上看到一款可视化音乐播放器,当前是觉得很是神奇,还能这么玩.由于当时刚刚转行不久,好多东西看得稀里糊涂不明白,于是趁着现在有时间又重新梳理了一遍,然后参照官网的API模拟做了一款网易 ...

  7. Browsing contexts 浏览器上下文

    浏览上下文就是document object 呈现给用户的所在的环境   每一个标签或者窗口都包含一个浏览器上下文,包括iframe   frames      每一个browsing context ...

  8. HTML DOM应用案例1

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. SharpGL(46)用Billboard绘制头顶文字

    CSharpGL(46)用Billboard绘制头顶文字 本文介绍CSharpGL用Billboard绘制头顶文字的方法.效果如下图所示. 下载 CSharpGL已在GitHub开源,欢迎对OpenG ...

  10. ubuntu server小技巧(不定期更新)

    0.常用工具apt安装包名 # ssh服务器工具 apt-get install openssh-server # RabbitMQapt-get install rabbitmq-server # ...