In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Nginx service startup stop reload script known Nginx management commands are: start: / application/nginx/sbin/nginx stop: / application/nginx/sbin/nginx-s stop reload: / application/nginx/sbin/nginx-s reload Please use case script to simulate Nginx startup shutdown / etc/init.d/nginx {start | stop | restart | reload} and can be managed through chkonfig
Script:
#
# nginx startup script
# 2018-11-29
#
#! / bin/bash
# calling system functions and custom variables
[- f / etc/init.d/functions] & &. / etc/init.d/functions
Pidfile=/application/nginx/logs/nginx.pid
# shared functions
Publics () {
RETVAL=$?
If [$RETVAL-eq 0]; then
Action "Nginx is $1" / bin/true
Else
Actio "Nginx is $1" / bin/false
Fi
}
# launch function start
Start () {
If [- f $Pidfile]; then
Echo "Nginx is running"
Else
/ application/nginx/sbin/nginx
Publics Started
Fi
Return $RETVAL
}
# turn off function stop
Stop () {
If [!-f $Pidfile]; then
Echo "Nginx is not runing"
Else
/ application/nginx/sbin/nginx-s stop
Publics Stopped
Fi
Return $RETVAL
}
# reload the function reload
Reload () {
If [!-f $Pidfile]; then
Echo "Can't open $Pidfile, no such file directory"
Else
/ application/nginx/sbin/nginx-s reload
Publics Reload
Fi
Return $RETVAL
}
# case statement using selection
Case "$1" in
Start)
Start
RETVAL=$?
Stop)
Stop
RETVAL=$?
Reload)
Reload
RETVAL=$?
Restart)
Stop
Sleep 2
Start
RETVAL=$?
*)
Echo "USAGE:$0 {satrt | stop | restart | reload}"
Exit 1
Esac
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.