odhcpd: Fix dnsmasq re-reading hostfile
authorHans Dedecker <dedeckeh@gmail.com>
Thu, 17 Nov 2016 12:34:34 +0000 (13:34 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Tue, 13 Dec 2016 22:32:57 +0000 (23:32 +0100)
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@gmail.com>
package/network/services/odhcpd/Makefile
package/network/services/odhcpd/files/odhcpd-update

index f6ce26c..4df0f77 100644 (file)
@@ -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
index e17cd0b..5f800aa 100755 (executable)
@@ -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