~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to utopic/etc/init.d/rebuildd-httpd

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/bash
2
 
# rebuildd-httpd init script
3
 
#
4
 
### BEGIN INIT INFO
5
 
# Provides:          rebuildd-httpd
6
 
# Required-Start:    $remote_fs $network
7
 
# Required-Stop:     $remote_fs $network
8
 
# Should-Start:
9
 
# Should-Stop:
10
 
# Default-Start:     2 3 4 5
11
 
# Default-Stop:      0 1 6
12
 
# Short-Description: rebuild daemon Web server
13
 
# Description:       daemon providing Web interface to
14
 
#                    rebuild system for Debian packages
15
 
### END INIT INFO
16
 
 
17
 
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
18
 
DAEMON=/usr/sbin/rebuildd-httpd
19
 
NAME=rebuildd-httpd
20
 
DESC="rebuild daemon HTTP server"
21
 
 
22
 
test -x $DAEMON || exit 0
23
 
 
24
 
# Include rebuildd defaults if available
25
 
if [ -f /etc/default/rebuildd ] ; then
26
 
        . /etc/default/rebuildd
27
 
fi
28
 
 
29
 
test "$START_REBUILDD_HTTPD" = 1 || exit 0
30
 
 
31
 
. /lib/lsb/init-functions
32
 
 
33
 
set -e
34
 
 
35
 
case "$1" in
36
 
  start)
37
 
        log_daemon_msg "Starting $DESC" "$NAME"
38
 
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
39
 
                --background --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
40
 
        log_end_msg $?
41
 
        ;;
42
 
  stop)
43
 
        log_daemon_msg "Stopping $DESC" "$NAME"
44
 
        start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$NAME.pid
45
 
        log_end_msg $?
46
 
        ;;
47
 
  #reload)
48
 
        #
49
 
        #       If the daemon can reload its config files on the fly
50
 
        #       for example by sending it SIGHUP, do it here.
51
 
        #
52
 
        #       If the daemon responds to changes in its config file
53
 
        #       directly anyway, make this a do-nothing entry.
54
 
        #
55
 
        # echo "Reloading $DESC configuration files."
56
 
        # start-stop-daemon --stop --signal 1 --quiet --pidfile \
57
 
        #       /var/run/$NAME.pid --exec $DAEMON
58
 
  #;;
59
 
  force-reload)
60
 
        #
61
 
        #       If the "reload" option is implemented, move the "force-reload"
62
 
        #       option to the "reload" entry above. If not, "force-reload" is
63
 
        #       just the same as "restart" except that it does nothing if the
64
 
        #   daemon isn't already running.
65
 
        # check wether $DAEMON is running. If so, restart
66
 
        start-stop-daemon --stop --test --quiet --pidfile \
67
 
                /var/run/$NAME.pid --exec $DAEMON \
68
 
        && $0 restart \
69
 
        || exit 0
70
 
        ;;
71
 
  restart)
72
 
        log_daemon_msg "Restarting $DESC" "$NAME"
73
 
        start-stop-daemon --stop --quiet --pidfile \
74
 
                /var/run/$NAME.pid --exec $DAEMON
75
 
        sleep 1
76
 
        start-stop-daemon --start --quiet --pidfile \
77
 
                /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
78
 
        log_end_msg $?
79
 
        ;;
80
 
  *)
81
 
        N=/etc/init.d/$NAME
82
 
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
83
 
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
84
 
        exit 1
85
 
        ;;
86
 
esac
87
 
 
88
 
exit 0