]> TLD Linux GIT Repositories - packages/munin.git/blob - munin-node.init
- df fix, temporarily change soruce URL
[packages/munin.git] / munin-node.init
1 #! /bin/sh
2 #
3 # munin-node    Control the Munin Node Server (formerly Linpro RRD client)
4 #
5 # chkconfig: 2345 90 10
6 # description: munin node agents
7 # processname: munin-node
8 # config: /etc/munin/munin-node.conf
9 # pidfile: /var/run/munin/munin-node.pid
10
11 # Source function library.
12 . /etc/rc.d/init.d/functions
13
14 RETVAL=0
15 PROCNAME=munin-node
16
17 mkdir -p /var/run/munin 2>/dev/null
18 chown munin /var/run/munin
19
20 # See how we were called.
21 case "$1" in
22   start)
23         if [ ! -f /var/lock/subsys/munin-node ]; then
24                 msg_starting "Munin Node"
25                 daemon --fork --waitfortime 3 --waitforname munin-node munin-node
26                 RETVAL=$?
27                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/munin-node
28         else
29                 msg_already_running "Munin Node"
30         fi
31         ;;
32   stop)
33         if [ -f /var/lock/subsys/munin-node ]; then
34                 msg_stopping "Munin Node"
35                 killproc munin-node
36                 RETVAL=$?
37                 rm -f /var/lock/subsys/munin-node >/dev/null 2>/dev/null
38         else
39                 msg_not_running "Munin Node"
40         fi
41         ;;
42   status)
43         status munin-node
44         exit $?
45         ;;
46   restart|reload)
47         $0 stop
48         $0 start
49         exit $?
50         ;;
51   *)
52         echo "Usage: $0 {start|stop|status|restart}"
53         exit 1
54 esac
55
56 exit $RETVAL