3
# /etc/init.d/sd-event-dispatch
5
# and symbolic its link
7
# /usr/sbin/rcsd-event-dispatch
9
# chkconfig: 2345 01 99
10
# description: SubDomain event dispatcher
13
# Provides: sd-event-dispatch
14
# Required-Start: subdomain
15
# Default-Start: 3 4 5
16
# Default-Stop: 0 1 2 6
17
# Description: Start the SubDomain event dispacher
20
SD_EV_BIN=/usr/sbin/sd-event-dispatch.pl
21
test -x $SD_EV_BIN || exit 5
23
SD_EV_PIDFILE=/var/run/sd-event-dispatch.init.pid
27
# Shell functions sourced from /etc/rc.status:
28
# rc_check check and set local and overall rc status
29
# rc_status check and set local and overall rc status
30
# rc_status -v ditto but be verbose in local rc status
31
# rc_status -v -r ditto and clear the local rc status
32
# rc_failed set local and overall rc status to failed
33
# rc_reset clear local rc status (overall remains)
34
# rc_exit exit appropriate to overall rc status
36
# First reset status of this service
41
echo -n "Starting SubDomain Event daemon"
42
## Start daemon with startproc(8). If this fails
43
## the echo return value is set appropriate.
45
startproc -f -p $SD_EV_PIDFILE $SD_EV_BIN -o "PidFile=$SD_EV_PIDFILE"
47
# Remember status and be verbose
51
echo -n "Shutting down SubDomain Event daemon"
52
## Stop daemon with killproc(8) and if this fails
53
## set echo the echo return value.
55
/sbin/killproc -p $SD_EV_PIDFILE -TERM $SD_EV_BIN
57
# Remember status and be verbose
61
## Stop the service and if this succeeds (i.e. the
62
## service was running before), start it again.
63
$0 status >/dev/null && $0 restart
65
# Remember status and be quiet
69
## Stop the service and regardless of whether it was
70
## running or not, start it again.
74
# Remember status and be quiet
78
echo -n "Checking for SubDomain Event daemon"
79
## Check status with checkproc(8), if process is running
80
## checkproc will return with exit status 0.
82
# Status has a slightly different for the status command:
84
# 1 - service dead, but /var/run/ pid file exists
85
# 2 - service dead, but /var/lock/ lock file exists
86
# 3 - service not running
88
checkproc -p $SD_EV_PIDFILE $SD_EV_BIN
93
echo "Usage: $0 {start|stop|status|try-restart|restart}"