- added missing BRs
[packages/collectd.git] / collectd.init
CommitLineData
db900f38 1#!/bin/sh
2#
3# collectd collectd (collectd daemon)
4#
5# chkconfig: 345 93 11
6#
8bf92105
ER
7# description: utility that colect various system information into rrd files
8#
9# $Id$
db900f38 10
11# Source function library
12. /etc/rc.d/init.d/functions
13
14# Get service config
15[ -f /etc/sysconfig/collectd ] && . /etc/sysconfig/collectd
16
8bf92105
ER
17# Get network config
18. /etc/sysconfig/network
db900f38 19
8bf92105
ER
20# Check that networking is up.
21if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23 msg_network_down collectd
24 exit 1
25 fi
26else
27 exit 0
28fi
db900f38 29
8bf92105 30start() {
db900f38 31 # Check if the service is already running?
32 if [ ! -f /var/lock/subsys/collectd ]; then
33 msg_starting collectd
34 daemon /usr/sbin/collectd
35 RETVAL=$?
36 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/collectd
37 else
38 msg_already_running collectd
39 fi
8bf92105
ER
40}
41
42stop() {
db900f38 43 if [ -f /var/lock/subsys/collectd ]; then
44 msg_stopping collectd
45 killproc collectd
46 rm -f /var/lock/subsys/collectd >/dev/null 2>&1
47 else
48 msg_not_running collectd
49 fi
8bf92105
ER
50}
51
52condrestart() {
53 if [ -f /var/lock/subsys/collectd ]; then
54 stop
55 start
56 else
57 msg_not_running collectd
58 RETVAL=$1
59 fi
60}
61
62RETVAL=0
63case "$1" in
64 start)
65 start
66 ;;
67 stop)
68 stop
db900f38 69 ;;
70 restart)
8bf92105
ER
71 stop
72 start
73 ;;
74 try-restart)
75 condrestart 0
76 ;;
77 force-reload)
78 condrestart 7
db900f38 79 ;;
80 status)
81 status collectd
82 exit $?
83 ;;
84 *)
8bf92105 85 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
db900f38 86 exit 3
87esac
88
89exit $RETVAL
This page took 0.037891 seconds and 4 git commands to generate.