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 f6ce26c150efc571719368e4e84bbbe2411fce48..4df0f77a25481525bd9707ab82cfb719d88506ab 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 e17cd0bfff6bfbc3fcf474e8ea2275c043dcdc75..5f800aac60a882bc9284491cda21c465b7a71abf 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