3 # cr Conference Room IRC Daemon
7 # description: Conference Room is a IRC Daemon
11 # Source function library
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
19 # Get service config - may override defaults
20 [ -f /etc/sysconfig/cr ] && . /etc/sysconfig/cr
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/cr ]; then
35 msg_starting "Conference Room IRC Daemon"; busy
36 start-stop-daemon --start \
38 --exec /usr/lib/cr/programs/launcher \
40 -- /var/lib/cr $SERVICES
43 if [ $RETVAL -eq 0 ]; then
44 # write proper pidfile as it itself probably writes parent pid which is no longer there
45 pidfile=/var/lib/cr/CRServices.pid
46 pid=$(ps -o pid= -C ConfRoom | head -n1)
47 [ "$pid" ] && echo "$pid" > $pidfile
49 touch /var/lock/subsys/cr
54 msg_already_running "Conference Room IRC Daemon"
59 if [ -f /var/lock/subsys/cr ]; then
61 msg_stopping "Conference Room IRC Daemon"
62 start-stop-daemon --stop --oknodo --pidfile /var/lib/cr/CRServices.pid && ok || fail
63 rm -f /var/lock/subsys/cr
65 msg_not_running "Conference Room IRC Daemon"
70 if [ -f /var/lock/subsys/cr ]; then
74 msg_not_running "Conference Room IRC Daemon"
80 # See how we were called.
99 status --pidfile /var/lib/cr/CRServices.pid cr ConfRoom
103 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"