3 # nginx Nginx Web Server (light version)
6 # description: Nginx is a World Wide Web server. It is used to serve \
8 # processname: nginx-light
9 # pidfile: /var/run/nginx-light.pid
10 # config: /etc/nginx/nginx-light.conf
13 # Source function library
14 . /etc/rc.d/init.d/functions
17 . /etc/sysconfig/network
20 [ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25 msg_network_down nginx-light
32 if [ -d "${HTTPD_CONF:-'/etc/nginx/nginx-light.conf'}" ]; then
33 CFG="-f ${HTTPD_CONF:-'/etc/nginx/nginx-light.conf'}"
34 elif [ -n "$HTTPD_CONF" ]; then
35 echo "error: HTTPD_CONF='$HTTPD_CONF': not a file, not a directory"
42 # Check if the service is already running?
43 if [ ! -f /var/lock/subsys/nginx-light ]; then
44 msg_starting nginx-light
45 daemon nginx-light $CFG $HTTPD_OPTS
47 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nginx-light
49 msg_already_running nginx-light
55 if [ -f /var/lock/subsys/nginx-light ]; then
56 msg_stopping nginx-light
57 killproc --waitforname nginx-light --waitfortime 60 nginx-light $CFG
58 # Delete pidfile only when nginx was called successfully
60 rm -f /var/lock/subsys/nginx-light /var/run/nginx-light.pid >/dev/null 2>&1
63 msg_not_running nginx-light
68 # See how we were called.
84 reload|force-reload|graceful)
85 if [ -f /var/lock/subsys/nginx-light ]; then
86 msg_reloading nginx-light
87 killproc nginx-light -HUP
90 msg_not_running nginx-light
95 msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"