3 # collectd Initscript for collectd
5 # Authors: Florian Forster <octo@verplant.org>
6 # Sebastian Harl <sh@tokkee.org>
11 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
12 DESC="Statistics collection daemon"
14 DAEMON=/usr/sbin/$NAME
15 SCRIPTNAME=/etc/init.d/$NAME
18 CONFIGDIR=/etc/collectd
19 # for backward compatibility
20 FALLBACKCONF=/etc/collectd.conf
22 # Gracefully exit if the package has been removed.
23 test -x $DAEMON || exit 0
25 if [ -r /etc/default/$NAME ]
31 # Function that starts the daemon/service.
36 if [ ! -d "$CONFIGDIR" ]
38 if [ -e "$FALLBACKCONF" ]
40 $DAEMON -C "$FALLBACKCONF" 2> /dev/null
43 echo "This package is not configured yet. Please refer"
44 echo "to /usr/share/doc/collectd/README.Debian for"
50 for FILE in `ls $CONFIGDIR/*.conf 2>/dev/null`
52 NAME=`basename "$FILE" .conf`
61 $DAEMON -C "$FILE" 2> /dev/null
66 echo -n "$NAME failed"
74 echo -n "[no config found]"
83 # Function that stops the daemon/service.
86 start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
91 echo -n "Starting $DESC: $NAME"
96 echo -n "Stopping $DESC: $NAME"
100 restart|force-reload)
101 echo -n "Restarting $DESC: $NAME"
108 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
115 # vim: syntax=sh noexpandtab sw=8 ts=8 :