|
1 |
#!/bin/sh |
1 |
#!/bin/sh |
|
|
2 |
# pidfile: /var/run/univention-runit.pid |
2 |
### BEGIN INIT INFO |
3 |
### BEGIN INIT INFO |
3 |
# Provides: univention-runit |
4 |
# Provides: univention-runit |
4 |
# Required-Start: $local_fs |
5 |
# Required-Start: $local_fs |
|
39 |
NAME='univention-runit' |
40 |
NAME='univention-runit' |
40 |
DESC=$(get_lsb_header_val "$0" Short-Description) |
41 |
DESC=$(get_lsb_header_val "$0" Short-Description) |
41 |
DAEMON="/usr/sbin/runsvdir-start" |
42 |
DAEMON="/usr/sbin/runsvdir-start" |
|
|
43 |
PIDFILE='/var/run/univention-runit.pid' |
42 |
|
44 |
|
43 |
case "$1" in |
45 |
case "$1" in |
44 |
start) |
46 |
start) |
45 |
log_daemon_msg "Starting $DESC" "$NAME" |
47 |
log_daemon_msg "Starting $DESC" "$NAME" |
46 |
start-stop-daemon --start --background --exec "$DAEMON" |
48 |
start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" --make-pidfile --background --exec "$DAEMON" |
47 |
log_end_msg $? |
49 |
log_end_msg $? |
48 |
;; |
50 |
;; |
49 |
stop) |
51 |
stop) |
50 |
log_daemon_msg "Stopping $DESC" "$NAME" |
52 |
log_daemon_msg "Stopping $DESC" "$NAME" |
51 |
killall -s HUP runsvdir |
53 |
start-stop-daemon --stop --quiet --oknodo --pidfile "$PIDFILE" --remove-pidfile --retry HUP/30/KILL/5 --name runsvdir |
52 |
log_end_msg $? |
54 |
log_end_msg $? |
53 |
;; |
55 |
;; |
54 |
restart|force-reload) |
56 |
restart|force-reload) |
55 |
log_daemon_msg "Restarting $DESC" "$NAME" |
57 |
log_daemon_msg "Restarting $DESC" "$NAME" |
56 |
killall -s HUP runsvdir |
58 |
start-stop-daemon --stop --quiet --oknodo --pidfile "$PIDFILE" --remove-pidfile --retry HUP/30/KILL/5 --name runsvdir |
57 |
sleep 1 |
59 |
sleep 1 |
58 |
start-stop-daemon --start --background --exec "$DAEMON" |
60 |
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --make-pidfile --background --exec "$DAEMON" |
59 |
log_end_msg $? |
61 |
log_end_msg $? |
60 |
;; |
62 |
;; |
61 |
status) |
63 |
status) |
62 |
status_of_proc "$DAEMON" "$DESC" |
64 |
status_of_proc -p "$PIDFILE" "$DAEMON" "$DESC" |
63 |
;; |
65 |
;; |
64 |
*) |
66 |
*) |
65 |
echo "Usage: $0 {start|stop|restart|force-reload|status}" |
67 |
echo "Usage: $0 {start|stop|restart|force-reload|status}" |