packages/miniupnpd: use new service functions
authorNicolas Thill <nico@openwrt.org>
Wed, 16 Nov 2011 09:44:23 +0000 (09:44 +0000)
committerNicolas Thill <nico@openwrt.org>
Wed, 16 Nov 2011 09:44:23 +0000 (09:44 +0000)
SVN-Revision: 29178

net/miniupnpd/Makefile
net/miniupnpd/files/miniupnpd.init

index dc7af24d7b05fca2b58812fb8b926cf68583e68a..d11ea8ff9f92f3074477966d3ae81e25faab7d4b 100644 (file)
@@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=miniupnpd
 PKG_VERSION:=1.6.20110730
-PKG_RELEASE:=1
-PKG_MD5SUM:=8bd5c0447b6dc1101b96e958ee67d3ea
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://miniupnp.free.fr/files
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=8bd5c0447b6dc1101b96e958ee67d3ea
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -44,8 +44,8 @@ define Build/Compile
 endef
 
 define Package/miniupnpd/install
-       $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/iface $(1)/etc/hotplug.d/firewall
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/bin/miniupnpd
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/iface $(1)/etc/hotplug.d/firewall
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/sbin/miniupnpd
        $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd
        $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd
        $(INSTALL_DATA) ./files/miniupnpd.iface.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd
index 4eebe417028d604892d7d1e783482bd07b668d71..fa888dde43567fc3d1adbae88839bd62d1600f73 100644 (file)
@@ -1,6 +1,10 @@
 #!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
 START=95
 
+SERVICE_USE_PID=1
+
 upnpd_get_port_range() {
        local _var="$1"; shift
        local _val
@@ -166,9 +170,11 @@ start() {
                        miniupnpd_add_rules "$zone" "${extiface:-wan}" "$ifname"
 
                if [ "$logging" = "1" ]; then
-                       start-stop-daemon -b -S -x miniupnpd -- $args -d
+                       SERVICE_DAEMONIZE=1 \
+                       service_start /usr/sbin/miniupnpd $args -d
                else
-                       start-stop-daemon -S -x miniupnpd -- $args
+                       SERVICE_DAEMONIZE= \
+                       service_start /usr/sbin/miniupnpd $args
                fi
        else
                logger -t "upnp daemon" "external interface not found, not starting"
@@ -176,8 +182,7 @@ start() {
 }
 
 stop() {
-       start-stop-daemon -K -q -x miniupnpd -p /var/run/miniupnpd.pid
-       rm -f /var/run/miniupnpd.pid
+       service_stop /usr/sbin/miniupnpd
 
        type miniupnpd_remove_rules >/dev/null 2>/dev/null || \
                ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd