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