diff options
author | Daniel Golle <daniel@makrotopia.org> | 2020-01-03 13:39:06 +0200 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-01-07 15:37:22 +0200 |
commit | cd48d8d3420dd4df03daaa548227ceb487ba7104 (patch) | |
tree | aac7e15af032decca15a22b93e224cf4ace86112 /package/network | |
parent | 5e1604477ae675874892237e4c8615c4acbb83c3 (diff) | |
download | upstream-cd48d8d3420dd4df03daaa548227ceb487ba7104.tar.gz upstream-cd48d8d3420dd4df03daaa548227ceb487ba7104.tar.bz2 upstream-cd48d8d3420dd4df03daaa548227ceb487ba7104.zip |
dnsmasq: switch to /tmp/resolv.conf.d/resolv.conf.auto
Mount-bind directory instead of resolv.conf.auto file in jail to
avoid problems when the file is deleted/replaced.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/network')
-rw-r--r-- | package/network/services/dnsmasq/files/dhcp.conf | 2 | ||||
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf index 360c7d79ee..19052e2333 100644 --- a/package/network/services/dnsmasq/files/dhcp.conf +++ b/package/network/services/dnsmasq/files/dhcp.conf @@ -13,7 +13,7 @@ config dnsmasq option authoritative 1 option readethers 1 option leasefile '/tmp/dhcp.leases' - option resolvfile '/tmp/resolv.conf.auto' + option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto' #list server '/mycompany.local/1.2.3.4' option nonwildcard 1 # bind to & keep track of interfaces #list interface br-lan diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 94a069f1ac..ae02f322d5 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -768,7 +768,7 @@ dnsmasq_start() { local cfg="$1" local disabled user_dhcpscript - local resolvfile localuse=0 + local resolvfile resolvdir localuse=0 config_get_bool disabled "$cfg" disabled 0 [ "$disabled" -gt 0 ] && return 0 @@ -923,10 +923,11 @@ dnsmasq_start() config_get_bool noresolv "$cfg" noresolv 0 if [ "$noresolv" != "1" ]; then - config_get resolvfile "$cfg" resolvfile /tmp/resolv.conf.auto + config_get resolvfile "$cfg" resolvfile /tmp/resolv.conf.d/resolv.conf.auto [ -n "$resolvfile" -a ! -e "$resolvfile" ] && touch "$resolvfile" xappend "--resolv-file=$resolvfile" - [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && localuse=1 + [ "$resolvfile" = "/tmp/resolv.conf.d/resolv.conf.auto" ] && localuse=1 + resolvdir="$(dirname "$resolvfile")" fi config_get_bool localuse "$cfg" localuse "$localuse" @@ -1070,7 +1071,7 @@ dnsmasq_start() procd_set_param respawn procd_add_jail dnsmasq ubus log - procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE $DHCPBOGUSHOSTNAMEFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT + procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE $DHCPBOGUSHOSTNAMEFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvdir $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile procd_close_instance @@ -1084,9 +1085,9 @@ dnsmasq_stop() config_get_bool noresolv "$cfg" noresolv 0 config_get resolvfile "$cfg" "resolvfile" - [ "$noresolv" = 0 -a "$resolvfile" = "/tmp/resolv.conf.auto" ] && localuse=1 + [ "$noresolv" = 0 -a "$resolvfile" = "/tmp/resolv.conf.d/resolv.conf.auto" ] && localuse=1 config_get_bool localuse "$cfg" localuse "$localuse" - [ "$localuse" -gt 0 ] && ln -sf "/tmp/resolv.conf.auto" /tmp/resolv.conf + [ "$localuse" -gt 0 ] && ln -sf "/tmp/resolv.conf.d/resolv.conf.auto" /tmp/resolv.conf rm -f ${BASEDHCPSTAMPFILE}.${cfg}.*.dhcp } |