7 PID
="/var/run/nginx/nginx.pid"
8 [ -z "$NGINX_CONFIG" ] && NGINX_CONFIG
="/etc/nginx/nginx.conf"
10 function check_config
{
11 stat_busy
"Checking configuration"
12 /usr
/sbin
/nginx
-q -t -c "$NGINX_CONFIG"
22 [ "$_nocheck" ] && check_config
23 stat_busy
"Starting Nginx"
24 if [ -s "$PID" ]; then
27 stat_busy
"Nginx is already running"
30 /usr
/sbin
/nginx
-c "$NGINX_CONFIG" &>/dev
/null
39 stat_busy
"Stopping Nginx"
40 kill -QUIT `cat "$PID"` &>/dev
/null
57 if [ -s "$PID" ]; then
58 status
"Reloading Nginx Configuration" kill -HUP `cat "$PID"`
63 if [ -s "$PID" ]; then
64 status
"Upgrading Nginx" kill -USR2 `cat "$PID"`
67 if [ -f "${PID}.oldbin" ]; then
68 status
"Stopping old Nginx" kill -QUIT `cat "${PID}.oldbin"`
75 echo "usage: $0 {start|stop|restart|reload|upgrade|check}"