]> git.pld-linux.org Git - packages/cancd.git/blob - cancd.init
- used template.init from rc-scripts
[packages/cancd.git] / cancd.init
1 #!/bin/sh
2 #
3 # cancd cancd short service description
4 #
5 # chkconfig:    2345 29 20
6 #
7 # description:  This is the CA NetConsole Daemon, \
8 #       a daemon to receive output from the Linux netconsole driver.
9 #
10 # $Id$
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get service config - may override defaults
19 [ -f /etc/sysconfig/cancd ] && . /etc/sysconfig/cancd
20
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23         if [ ! -f /var/lock/subsys/network ]; then
24                 msg_network_down cancd
25                 exit 1
26         fi
27 else
28         exit 0
29 fi
30
31
32 # See how we were called.
33 case "$1" in
34   start)
35         # Check if the service is already running?
36         if [ ! -f /var/lock/subsys/cancd ]; then
37                 msg_starting cancd
38                 daemon cancd
39                 RETVAL=$?
40                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cancd
41         else
42                 msg_already_running cancd
43         fi
44         ;;
45   stop)
46         if [ -f /var/lock/subsys/cancd ]; then
47                 # Stop daemons.
48                 msg_stopping cancd
49                 killproc cancd
50                 rm -f /var/lock/subsys/cancd
51         else
52                 msg_not_running cancd
53         fi
54         ;;
55   restart|force-reload)
56         $0 stop
57         $0 start
58         exit $?
59         ;;
60   status)
61         status cancd
62         RETVAL=$?
63         ;;
64   *)
65         msg_usage "$0 {start|stop|restart|force-reload|status}"
66         exit 3
67 esac
68
69 exit $RETVAL
70
71 # This must be last line !
72 # vi:syntax=sh
This page took 0.050679 seconds and 3 git commands to generate.