~brightbox/brightbox/deb-nginx-ruby-ng

« back to all changes in this revision

Viewing changes to debian/nginx-common.nginx.init

  • Committer: John Leach
  • Date: 2012-09-11 14:41:56 UTC
  • mfrom: (0.1.63)
  • Revision ID: git-v1:4e13f237ac0e962872d612f68e7162776ab0bfe3
Merge remote-tracking branch 'debian/master' into ruby-ng

Conflicts:
        debian/changelog
        debian/nginx-common.nginx.init

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
3
3
### BEGIN INIT INFO
4
 
# Provides:          nginx
 
4
# Provides:       nginx
5
5
# Required-Start:    $local_fs $remote_fs $network $syslog $named
6
6
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
7
7
# Default-Start:     2 3 4 5
35
35
        fi
36
36
}
37
37
 
 
38
start() {
 
39
                test_nginx_config
 
40
                # Check if the ULIMIT is set in /etc/default/nginx
 
41
                if [ -n "$ULIMIT" ]; then
 
42
                        # Set the ulimits
 
43
                        ulimit $ULIMIT
 
44
                fi
 
45
                start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
 
46
                        --retry 5 --exec $DAEMON -- $DAEMON_OPTS || true
 
47
}
 
48
 
 
49
stop() {
 
50
                start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
 
51
                        --retry 5 --exec $DAEMON || true
 
52
}
 
53
 
38
54
case "$1" in
39
55
        start)
40
56
                echo -n "Starting $DESC: "
41
 
                test_nginx_config
42
 
                # Check if the ULIMIT is set in /etc/default/nginx
43
 
                if [ -n "$ULIMIT" ]; then
44
 
                        # Set the ulimits
45
 
                        ulimit $ULIMIT
46
 
                fi
47
 
                start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
48
 
                        --exec $DAEMON -- $DAEMON_OPTS || true
 
57
                start
49
58
                echo "$NAME."
50
59
                ;;
51
60
 
52
61
        stop)
53
62
                echo -n "Stopping $DESC: "
54
 
                start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
55
 
                        --exec $DAEMON || true
 
63
                stop
56
64
                echo "$NAME."
57
65
                ;;
58
66
 
59
67
        restart|force-reload)
60
68
                echo -n "Restarting $DESC: "
61
 
                start-stop-daemon --stop --quiet --pidfile \
62
 
                    /var/run/$NAME.pid --exec $DAEMON || true
 
69
                stop
63
70
                sleep 1
64
 
                test_nginx_config
65
 
                # Check if the ULIMIT is set in /etc/default/nginx
66
 
                if [ -n "$ULIMIT" ]; then
67
 
                        # Set the ulimits
68
 
                        ulimit $ULIMIT
69
 
                fi
70
 
                start-stop-daemon --start --quiet --pidfile \
71
 
                        /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true
72
71
                echo "$NAME."
 
72
                start
73
73
                ;;
74
74
 
75
75
        reload)
92
92
        status)
93
93
                status_of_proc -p /var/run/$NAME.pid "$DAEMON" nginx && exit 0 || exit $?
94
94
                ;;
 
95
 
95
96
        *)
96
97
                echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest}" >&2
97
98
                exit 1