From: S.Çağlar Onur Date: Sun, 18 Jan 2015 00:08:01 +0000 (-0500) Subject: restore the dropped bits of 1c1bb85ad2b6 and also implement the logic X-Git-Tag: lxc-1.1.0.rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fdd4b0c119f5bd14fed3d4a6424e5a4d00c360e;p=thirdparty%2Flxc.git restore the dropped bits of 1c1bb85ad2b6 and also implement the logic suggested at https://lists.linuxcontainers.org/pipermail/lxc-devel/2014-December/010985.html Signed-off-by: S.Çağlar Onur Acked-by: Stéphane Graber --- diff --git a/config/init/common/lxc-net.in b/config/init/common/lxc-net.in index 5567fee2c..dcbe15565 100644 --- a/config/init/common/lxc-net.in +++ b/config/init/common/lxc-net.in @@ -115,7 +115,15 @@ start() { if [ -n "$LXC_DOMAIN" ]; then LXC_DOMAIN_ARG="-s $LXC_DOMAIN -S /$LXC_DOMAIN/" fi - dnsmasq $LXC_DOMAIN_ARG -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file="${varrun}"/dnsmasq.pid --conf-file=${LXC_DHCP_CONFILE} --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override --except-interface=lo --interface=${LXC_BRIDGE} --dhcp-leasefile=/var/lib/misc/dnsmasq.${LXC_BRIDGE}.leases --dhcp-authoritative || cleanup + + # https://lists.linuxcontainers.org/pipermail/lxc-devel/2014-October/010561.html + for DNSMASQ_USER in lxc-dnsmasq dnsmasq nobody + do + if getent passwd ${DNSMASQ_USER} >/dev/null; then + break + fi + done + dnsmasq $LXC_DOMAIN_ARG -u ${DNSMASQ_USER} --strict-order --bind-interfaces --pid-file="${varrun}"/dnsmasq.pid --conf-file=${LXC_DHCP_CONFILE} --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override --except-interface=lo --interface=${LXC_BRIDGE} --dhcp-leasefile=/var/lib/misc/dnsmasq.${LXC_BRIDGE}.leases --dhcp-authoritative || cleanup touch "${varrun}"/network_up touch "${lockdir}"/lxc-net }