avoids nasty race condition between manual "dnsmasq restart" and
"killall -HUP dnsmasq" by dhcp client, killing the init script accidentially

Signed-off-by: Ulrich Weber <u...@xyne.com>
---
 package/network/ipv6/6relayd/files/6relayd-update   | 2 +-
 package/network/services/dnsmasq/files/dnsmasq.init | 9 +++++++++
 package/network/services/odhcpd/files/odhcpd-update | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/package/network/ipv6/6relayd/files/6relayd-update 
b/package/network/ipv6/6relayd/files/6relayd-update
index 20980f2..c72c88a 100755
--- a/package/network/ipv6/6relayd/files/6relayd-update
+++ b/package/network/ipv6/6relayd/files/6relayd-update
@@ -1,3 +1,3 @@
 #!/bin/sh
 # Make dnsmasq reread hostfile
-killall -SIGHUP dnsmasq
+/etc/init.d/dnsmasq reload
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
b/package/network/services/dnsmasq/files/dnsmasq.init
index 0ff987f..5d33557 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -579,6 +579,15 @@ reload_service() {
        return 0
 }
 
+reload_service() {
+       DNSMASQ_PID=$(cat /var/run/dnsmasq.pid)
+
+       if [ "$DNSMASQ_PID" != "" ]
+       then
+               kill -s HUP $DNSMASQ_PID
+       fi
+}
+
 stop_service() {
        [ -f /tmp/resolv.conf ] && {
                rm -f /tmp/resolv.conf
diff --git a/package/network/services/odhcpd/files/odhcpd-update 
b/package/network/services/odhcpd/files/odhcpd-update
index 20980f2..c72c88a 100755
--- a/package/network/services/odhcpd/files/odhcpd-update
+++ b/package/network/services/odhcpd/files/odhcpd-update
@@ -1,3 +1,3 @@
 #!/bin/sh
 # Make dnsmasq reread hostfile
-killall -SIGHUP dnsmasq
+/etc/init.d/dnsmasq reload
-- 
1.8.3.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to