dnsmasq: replace the iface hotplug script with a procd trigger
authorFelix Fietkau <nbd@nbd.name>
Fri, 29 Jul 2016 12:56:35 +0000 (14:56 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 29 Jul 2016 14:41:09 +0000 (16:41 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/dnsmasq/Makefile
package/network/services/dnsmasq/files/dnsmasq.hotplug [deleted file]
package/network/services/dnsmasq/files/dnsmasq.init

index 3aff519e6bc51c1a2b06098a02386cde90653d7a..d5acef578eec3afc66672c4a80cb09cd3fa048c8 100644 (file)
@@ -145,8 +145,6 @@ define Package/dnsmasq/install
        $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
-       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
-       $(INSTALL_DATA) ./files/dnsmasq.hotplug $(1)/etc/hotplug.d/iface/25-dnsmasq
        $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
        $(INSTALL_DATA) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec
 endef
diff --git a/package/network/services/dnsmasq/files/dnsmasq.hotplug b/package/network/services/dnsmasq/files/dnsmasq.hotplug
deleted file mode 100644 (file)
index ca5d10c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-[ "$ACTION" = ifup ] || exit 0
-
-/etc/init.d/dnsmasq enabled && /etc/init.d/dnsmasq start
index 0941f87fa8d028e8fc5aa6153bd402d80b31fde4..4047768bba14449d06f3d1dd8dbc19842141d3c8 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2007-2012 OpenWrt.org
 
-START=60
+START=19
 
 USE_PROCD=1
 PROG=/usr/sbin/dnsmasq
@@ -622,14 +622,18 @@ dhcp_relay_add() {
 service_triggers()
 {
        procd_add_reload_trigger "dhcp"
+       procd_add_raw_trigger "interface.*" 2000 /etc/init.d/dnsmasq reload
 }
 
-boot() {
-       # Will be launched through hotplug
-       return 0
+boot()
+{
+       BOOT=1
+       start "$@"
 }
 
 start_service() {
+       [ -n "$BOOT" ] && return
+
        include /lib/functions
 
        config_load dhcp