- init file for collectd
[packages/collectd.git] / collectd.init
1 #!/bin/sh
2 #
3 # collectd      collectd (collectd daemon)
4 #
5 # chkconfig:    345 93 11
6 #
7 # description:  utility that colect various system information  \
8 #               into rrd files \
9
10
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get service config
16 [ -f /etc/sysconfig/collectd ] && . /etc/sysconfig/collectd
17
18
19
20 RETVAL=0
21
22 case "$1" in
23   start)
24         # Check if the service is already running?
25         if [ ! -f /var/lock/subsys/collectd ]; then
26                 msg_starting collectd
27                 daemon /usr/sbin/collectd
28                 RETVAL=$?
29                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/collectd
30         else
31                 msg_already_running collectd
32         fi
33         ;;
34   stop)
35         if [ -f /var/lock/subsys/collectd ]; then
36                 msg_stopping collectd
37                 killproc collectd
38                 rm -f /var/lock/subsys/collectd >/dev/null 2>&1
39         else
40                 msg_not_running collectd
41         fi
42         ;;
43   restart)
44         $0 stop
45         $0 start
46         exit $?
47         ;;
48   status)
49         status collectd
50         exit $?
51         ;;
52   *)
53         msg_usage "$0 {start|stop|restart|status}"
54         exit 3
55 esac
56
57 exit $RETVAL
58
This page took 0.032179 seconds and 3 git commands to generate.