[Packages] Fix init script props
[openwrt/svn-archive/archive.git] / utils / collectd / files / collectd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 START=80
5 BINARY="/usr/sbin/collectd"
6 PIDFILE="/var/run/collectd.pid"
7 DATADIR="/var/lib/collectd"
8
9 start() {
10 [ -x "$BINARY" ] || exit 1;
11
12 if [ -e "$PIDFILE" ]
13 then
14 kill $(cat "$PIDFILE") 2>/dev/null
15 sleep 1
16 fi
17
18 [ -d "$DATADIR" ] || mkdir -p "$DATADIR";
19
20 $BINARY
21 }
22
23 stop() {
24 kill $(cat "$PIDFILE") 2>/dev/null
25 }
26
27 restart() {
28 start
29 }