]> git.pld-linux.org Git - packages/bb4.git/blob - bb4.init
- remove remnants from template.init
[packages/bb4.git] / bb4.init
1 #!/bin/sh
2 #
3 # bb            Big Brother System and Network Monitor
4 #
5 # chkconfig:    345 95 01
6 # description:  Big Brother is System and Network Monitoring system
7 # processname:  bbd
8
9 # Source function library
10 . /etc/rc.d/init.d/functions
11
12 # Get network config
13 . /etc/sysconfig/network
14
15 # Get service config
16 [ -f /etc/sysconfig/bb ] && . /etc/sysconfig/bb
17
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20         if [ ! -f /var/lock/subsys/network ]; then
21                 msg_network_down bb
22                 exit 1
23         fi
24 else
25         exit 0
26 fi
27
28 # See how we were called.
29 case "$1" in
30   start)
31         # Check if the service is already running?
32         if [ ! -f /var/lock/subsys/bb ]; then
33                 msg_starting bb
34                 su - bb -c '/usr/bin/setsid /usr/lib/bb/runbb.sh start' </dev/null >/dev/null 2>&1
35                 RETVAL=$?
36                 [ $RETVAL -eq 0 ] && ok || fail
37                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bb
38         else
39                 msg_already_running bb
40         fi
41         ;;
42   stop)
43         # Stop daemons.
44         if [ -f /var/lock/subsys/bb ]; then
45                 msg_stopping bb
46                 su - bb -c '/usr/lib/bb/runbb.sh stop' >/dev/null 2>&1
47                 [ $? -eq 0 ] && ok || died
48                 rm -f /var/lock/subsys/bb >/dev/null 2>&1
49         else
50                 msg_not_running bb
51         fi
52         ;;
53   status)
54         ;;
55   restart|force-reload)
56         $0 stop
57         $0 start
58         exit $?
59         ;;
60   *)
61         msg_usage "$0 {start|stop|restart|force-reload|status}"
62         exit 3
63         ;;
64 esac
65
66 exit $RETVAL
This page took 0.101075 seconds and 3 git commands to generate.