]> git.pld-linux.org Git - packages/bb4.git/blob - bb4.init
- back to /home/services
[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                 # nls "ERROR: Networking is down. %s can't be run." <service>
22                 msg_network_down bb
23                 exit 1
24         fi
25 else
26         exit 0
27 fi
28
29 # See how we were called.
30 case "$1" in
31   start)
32         # Check if the service is already running?
33         if [ ! -f /var/lock/subsys/bb ]; then
34                 msg_starting bb
35                 su - bb -c '/usr/bin/setsid /usr/lib/bb/runbb.sh start' </dev/null >/dev/null 2>&1
36                 RETVAL=$?
37                 [ $RETVAL -eq 0 ] && ok || fail
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bb
39         else
40                 msg_already_running bb
41         fi
42         ;;
43   stop)
44         # Stop daemons.
45         if [ -f /var/lock/subsys/bb ]; then
46                 msg_stopping bb
47                 su - bb -c '/usr/lib/bb/runbb.sh stop' >/dev/null 2>&1
48                 [ $? -eq 0 ] && ok || died
49                 rm -f /var/lock/subsys/bb >/dev/null 2>&1
50         else
51                 msg_not_running bb
52         fi
53         ;;
54   status)
55         ;;
56   restart|force-reload)
57         $0 stop
58         $0 start
59         exit $?
60         ;;
61   *)
62         msg_usage "$0 {start|stop|restart|force-reload|status}"
63         exit 3
64         ;;
65 esac
66
67 exit $RETVAL
This page took 0.063651 seconds and 3 git commands to generate.