[source] dnsmasq: replace the iface hotplug script with a procd trigger

LEDE Commits lede-commits at lists.infradead.org
Fri Jul 29 07:41:28 PDT 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=a1681ce39bbbab20c46150ee28b63351396662c2

commit a1681ce39bbbab20c46150ee28b63351396662c2
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jul 29 14:56:35 2016 +0200

    dnsmasq: replace the iface hotplug script with a procd trigger
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/dnsmasq/Makefile              |  2 --
 package/network/services/dnsmasq/files/dnsmasq.hotplug |  5 -----
 package/network/services/dnsmasq/files/dnsmasq.init    | 12 ++++++++----
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 3aff519..d5acef5 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -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
index ca5d10c..0000000
--- a/package/network/services/dnsmasq/files/dnsmasq.hotplug
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-[ "$ACTION" = ifup ] || exit 0
-
-/etc/init.d/dnsmasq enabled && /etc/init.d/dnsmasq start
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 0941f87..4047768 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -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



More information about the lede-commits mailing list