packages/collectd: use new service functions
authorNicolas Thill <nico@openwrt.org>
Fri, 11 Nov 2011 15:46:32 +0000 (15:46 +0000)
committerNicolas Thill <nico@openwrt.org>
Fri, 11 Nov 2011 15:46:32 +0000 (15:46 +0000)
SVN-Revision: 28948

utils/collectd/Makefile
utils/collectd/files/collectd.init

index e7502c9beef9a51fbe0b498af3d5adeaeb45ba13..5390d88a224be02416960c4e50905bfa8658e0d7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# 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.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 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/
index 6204eabaa40fa4b1737d8504828c48bb72a25a78..8204c38acba5ce7f7f2198fad3bbab0516ba3ef3 100644 (file)
@@ -1,28 +1,15 @@
 #!/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
 }