dnsmasq: make /tmp/dnsmasq.d and /tmp/hosts preferred over UCI settings
[openwrt.git] / package / network / services / dnsmasq / files / dnsmasq.init
index bbe2b56..1b42cff 100644 (file)
@@ -135,6 +135,7 @@ dnsmasq() {
        append_bool "$cfg" proxydnssec "--proxy-dnssec"
        append_bool "$cfg" localservice "--local-service"
        append_bool "$cfg" quietdhcp "--quiet-dhcp"
+       append_bool "$cfg" sequential_ip "--dhcp-sequential-ip"
 
        append_parm "$cfg" dhcpscript "--dhcp-script"
        append_parm "$cfg" cachesize "--cache-size"
@@ -175,10 +176,6 @@ dnsmasq() {
        config_get hostsfile "$cfg" dhcphostsfile
        [ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"
 
-       mkdir -p /tmp/hosts /tmp/dnsmasq.d
-       xappend "--addn-hosts=/tmp/hosts"
-       xappend "--conf-dir=/tmp/dnsmasq.d"
-
        local rebind
        config_get_bool rebind "$cfg" rebind_protection 1
        [ $rebind -gt 0 ] && {
@@ -214,6 +211,10 @@ dnsmasq() {
 
        xappend "--dhcp-broadcast=tag:needs-broadcast"
 
+       mkdir -p /tmp/hosts /tmp/dnsmasq.d
+       xappend "--addn-hosts=/tmp/hosts"
+       xappend "--conf-dir=/tmp/dnsmasq.d"
+
        echo >> $CONFIGFILE
 }
 
@@ -556,7 +557,7 @@ start_service() {
        procd_set_param respawn
 
        procd_add_jail dnsmasq ubus log
-       procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /dev/urandom /etc/dnsmasq.conf /tmp/dnsmasq.d /tmp/resolv.conf.auto /etc/hosts /etc/ethers
+       procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom /etc/dnsmasq.conf /tmp/dnsmasq.d /tmp/resolv.conf.auto /etc/hosts /etc/ethers
        procd_add_jail_mount_rw /var/run/dnsmasq/ /tmp/dhcp.leases $TIMESTAMPFILE
        
        procd_close_instance