dnsmasq: use hostsdir instead of addn-hosts
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Fri, 10 May 2019 19:14:59 +0000 (20:14 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 21 Feb 2024 21:31:36 +0000 (22:31 +0100)
dnsmasq will dynamically scan changes/additions to hosts in hostsdir whereas
addn-hosts needs a SIGHUP.

Take advantage of this automatic updating in preparation for a dhcpd
update take only signals
addn-hosts

-       xappend "--addn-hosts=$(dirname $HOSTFILE)"
+       xappend "--hostsdir=$(dirname $HOSTFILE)"

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
package/network/services/dnsmasq/files/dnsmasq.init

index fd2ce3d2de0c1342e85dcee810250c0c08a50af4..ec9ae84ce1022c1bd142e62201ddf31e20c4f280 100755 (executable)
@@ -1000,8 +1000,8 @@ dnsmasq_start()
                xappend "--addn-hosts=$HOSTFILE"
                append EXTRA_MOUNT "$HOSTFILE"
        else
-               xappend "--addn-hosts=$HOSTFILE_DIR"
-               append EXTRA_MOUNT "$HOSTFILE_DIR"
+               xappend "--addn-hosts=$(dirname $HOSTFILE)"
+               append EXTRA_MOUNT "$(dirname $HOSTFILE)"
        fi
        config_list_foreach "$cfg" "addnhosts" append_addnhosts
        config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain
@@ -1105,7 +1105,6 @@ dnsmasq_start()
 
        xappend "--dhcp-broadcast=tag:needs-broadcast"
 
-
        config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq.d"
        xappend "--conf-dir=$dnsmasqconfdir"
        dnsmasqconfdir="${dnsmasqconfdir%%,*}"