package/dnsmasq: use new service wrapper
authorNicolas Thill <nico@openwrt.org>
Mon, 7 Nov 2011 22:58:45 +0000 (22:58 +0000)
committerNicolas Thill <nico@openwrt.org>
Mon, 7 Nov 2011 22:58:45 +0000 (22:58 +0000)
SVN-Revision: 28837

package/dnsmasq/Makefile
package/dnsmasq/files/dnsmasq.init

index 540d47689edc7f1d4e7f4b4f4567e0e8527df5c2..1294a8b45fa897c40f15be49936b1d76d6776fd4 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.58
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
index 3d9060d81dd55d12d282de7cdfc8ad445cf81704..80ab250baa2d11282350bd9fcfc2a467a7eefea4 100644 (file)
@@ -2,6 +2,9 @@
 # Copyright (C) 2007 OpenWrt.org
 
 START=60
+
+SERVICE_USE_PID=1
+
 DNS_SERVERS=""
 DOMAIN=""
 
@@ -397,7 +400,7 @@ start() {
        config_foreach dhcp_add dhcp
        config_foreach dhcp_cname_add cname
 
-       /usr/sbin/dnsmasq $args && {
+       service_start /usr/sbin/dnsmasq $args && {
                rm -f /tmp/resolv.conf
                [ -n "$DOMAIN" ] && echo "search $DOMAIN" >> /tmp/resolv.conf
                DNS_SERVERS="$DNS_SERVERS 127.0.0.1"
@@ -408,10 +411,10 @@ start() {
 }
 
 stop() {
-       [ -f /tmp/resolv.conf ] && {
-               rm -f /tmp/resolv.conf
-               ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
+       service_stop /usr/sbin/dnsmasq && {
+               [ -f /tmp/resolv.conf ] && {
+                       rm -f /tmp/resolv.conf
+                       ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
+               }
        }
-       service_kill dnsmasq /var/run/dnsmasq.pid
-       return 0
 }