#!/bin/sh
#nginx start script
#Date:2017-6-21
#Author:xcn(baishuchao@yeah.net)
#version 2.0
RETVAL=0
path="/application/nginx"
#Source functions library
. /etc/init.d/functions
start(){
if [ ! -f "$path/logs/nginx.pid" ]
then
[ -x $path/sbin/nginx ]||exit 1
$path/sbin/nginx
RETVAL=$?
if [ -f $path/logs/nginx.pid ];then
action "Nginx startup" /bin/true
else
action "Nginx startup" /bin/false
fi
else
echo "Nginx is running."
fi
return $RETVAL
}
stop(){
if [ ! -f "$path/logs/nginx.pid" ]
then
echo "nginx is not running.need not to stop it."
else
[ -x $path/sbin/nginx ]||exit 1
[ -f "$path/logs/nginx.pid" ]&&{
kill `cat $path/logs/nginx.pid`
RETVAL=$?
}
if [ ! -f "$path/logs/nginx.pid" ];then
action "Nginx is stopped." /bin/true
else
action "Nginx is stopped." /bin/false
fi
fi
return $RETVAL
}
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
restart)
$0 stop
sleep 2
$0 start
RETVAL=$?
;;
reload)
$path/sbin/nginx reload
RETVAL=$?
;;
*)
echo "USAGE:$0 {start|stop|restart|reload}"
esac
exit $RETVAL
成都創(chuàng)新互聯(lián)公司主營向陽網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,
成都app軟件開發(fā)公司,向陽h5
微信小程序搭建,向陽網(wǎng)站營銷推廣歡迎向陽等地區(qū)企業(yè)咨詢
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
網(wǎng)站題目:Nginx啟動腳本-創(chuàng)新互聯(lián)
標(biāo)題路徑:
http://weahome.cn/article/cdoige.html