]> git.pld-linux.org Git - packages/nginx.git/blame - nginx-light.init
- update to latest intermediate compatibility https://wiki.mozilla.org/Security/Serve...
[packages/nginx.git] / nginx-light.init
CommitLineData
e3557836 1#!/bin/sh
2#
3# nginx Nginx Web Server (light version)
4#
5# chkconfig: 345 85 15
6# description: Nginx is a World Wide Web server. It is used to serve \
7# HTML files and CGI.
8# processname: nginx-light
9# pidfile: /var/run/nginx-light.pid
10# config: /etc/nginx/nginx-light.conf
11
12
13# Source function library
14. /etc/rc.d/init.d/functions
15
16# Get network config
17. /etc/sysconfig/network
18
19# Get service config
20[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
21
22# Check that networking is up.
23if is_yes "${NETWORKING}"; then
24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25 msg_network_down nginx-light
26 exit 1
27 fi
28else
29 exit 0
30fi
31
e3557836 32start() {
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/nginx-light ]; then
35 msg_starting nginx-light
fa34d6db 36 daemon nginx-light
e3557836 37 RETVAL=$?
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nginx-light
39 else
40 msg_already_running nginx-light
41 fi
42}
43
44stop() {
45 # Stop daemons.
46 if [ -f /var/lock/subsys/nginx-light ]; then
47 msg_stopping nginx-light
fa34d6db 48 killproc --waitforname nginx-light --waitfortime 60 nginx-light
e3557836 49 # Delete pidfile only when nginx was called successfully
50 if [ $? -eq 0 ]; then
51 rm -f /var/lock/subsys/nginx-light /var/run/nginx-light.pid >/dev/null 2>&1
52 fi
53 else
54 msg_not_running nginx-light
55 fi
56}
57
58RETVAL=0
59# See how we were called.
60case "$1" in
61 start)
62 start
63 ;;
64 stop)
65 stop
66 ;;
67 status)
68 status nginx-light
69 RETVAL=$?
70 ;;
71 restart)
72 stop
73 start
74 ;;
75 reload|force-reload|graceful)
76 if [ -f /var/lock/subsys/nginx-light ]; then
77 msg_reloading nginx-light
78 killproc nginx-light -HUP
79 RETVAL=$?
80 else
81 msg_not_running nginx-light
82 RETVAL=7
83 fi
84 ;;
85 *)
86 msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
87 exit 3
88 ;;
89esac
90
91exit $RETVAL
This page took 0.185379 seconds and 4 git commands to generate.