#
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=collectd
PKG_VERSION:=4.10.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://collectd.org/files/
#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
START=80
-BINARY="/usr/sbin/collectd"
-PIDFILE="/var/run/collectd.pid"
-DATADIR="/var/lib/collectd"
-start() {
- [ -x "$BINARY" ] || exit 1
- [ -d "$DATADIR" ] || mkdir -p "$DATADIR";
+SERVICE_USE_PID=1
- rm -f $PIDFILE
- start-stop-daemon -S -q -b -x $BINARY -m -p $PIDFILE -- -f
+start() {
+ mkdir -m 0755 -p /var/lib/collectd
+ service_start /usr/sbin/collectd
}
stop() {
- [ -s "$PIDFILE" ] && {
- local pid="$(cat $PIDFILE)"
-
- start-stop-daemon -K -q -n ${BINARY##*/} -p $PIDFILE
-
- for i in 1 2 3 4 5; do
- kill -0 $pid 2>/dev/null || return
- sleep 1
- done
- }
+ service_stop /usr/sbin/collectd
}