[source] odhcpd: Fix dnsmasq re-reading hostfile

LEDE Commits lede-commits at lists.infradead.org
Tue Dec 13 14:33:51 PST 2016


dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/a7c2310278c3554e78f26f6f84803669d9573dc6

commit a7c2310278c3554e78f26f6f84803669d9573dc6
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Thu Nov 17 13:34:34 2016 +0100

    odhcpd: Fix dnsmasq re-reading hostfile
    
    Depending on the dhcp uci config pidof dnsmasq can return
    multiple pids. Fix re-reading of the hostfile by dnsmasq in
    such case by sending SIGHUP signal to each of the returned
    pids.
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/services/odhcpd/Makefile            | 2 +-
 package/network/services/odhcpd/files/odhcpd-update | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index f6ce26c..4df0f77 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcpd
-PKG_VERSION:=2016-11-21
+PKG_VERSION:=2016-12-13
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
diff --git a/package/network/services/odhcpd/files/odhcpd-update b/package/network/services/odhcpd/files/odhcpd-update
index e17cd0b..5f800aa 100755
--- a/package/network/services/odhcpd/files/odhcpd-update
+++ b/package/network/services/odhcpd/files/odhcpd-update
@@ -2,4 +2,7 @@
 # Make dnsmasq reread hostfile
 
 pid=$(pidof dnsmasq)
-[ "$(readlink /proc/$pid/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $pid
+
+for i in $pid; do
+	[ "$(readlink /proc/$i/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $i
+done



More information about the lede-commits mailing list