~spuul/nginx/trunk

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2013-11-22 12:23:25 UTC
  • mfrom: (4.3.6 sid)
  • Revision ID: package-import@ubuntu.com-20131122122325-6i9ns8d0e4fceepd
Tags: 1.4.4-1ubuntu1
* Resynchronise with Debian (LP: #1253691).  Remaining changes:
  - debian/patches/ubuntu-branding.patch:
    + Add Ubuntu branding to server_tokens.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
fi
40
40
 
41
41
test_nginx_config() {
 
42
                set +e
42
43
                $DAEMON -t $DAEMON_OPTS >/dev/null 2>&1
43
44
                retvar=$?
 
45
 
44
46
                if [ $retvar -ne 0 ]
45
47
                then
46
48
                        exit $retvar
47
49
                fi
 
50
                set -e
48
51
}
49
52
 
50
53
start() {
59
62
 
60
63
case "$1" in
61
64
        start)
62
 
                test_nginx_config
63
65
                log_daemon_msg "Starting $DESC" "$NAME"
 
66
                test_nginx_config
64
67
                start
65
68
                log_end_msg $?
66
69
                ;;
67
70
 
68
71
        stop)
 
72
                stop
69
73
                log_daemon_msg "Stopping $DESC" "$NAME"
70
 
                stop
71
74
                log_end_msg $?
72
75
                ;;
73
76
 
74
77
        restart|force-reload)
75
 
                test_nginx_config
76
78
                log_daemon_msg "Restarting $DESC" "$NAME"
 
79
                test_nginx_config
77
80
                stop
78
81
                sleep 1
79
82
                start
81
84
                ;;
82
85
 
83
86
        reload)
84
 
                test_nginx_config
85
87
                log_daemon_msg "Reloading $DESC configuration" "$NAME"
 
88
                test_nginx_config
86
89
                start-stop-daemon --stop --signal HUP --quiet --pidfile $PID \
87
90
                        --oknodo --exec $DAEMON
88
91
                log_end_msg $?
90
93
 
91
94
        configtest|testconfig)
92
95
                log_daemon_msg "Testing $DESC configuration"
93
 
                if test_nginx_config; then
94
 
                        log_daemon_msg "$NAME"
95
 
                else
96
 
                        exit $?
97
 
                fi
 
96
                test_nginx_config
98
97
                log_end_msg $?
99
98
                ;;
100
99