mdnstool: add support for a "hybrid" network mode

Normally we advertise $(hostname).local. by MDNS on eth0. If the new
"hybrid" networking mode is configured, we will use 2 NICs and eth1
will be connected via vmnet, and so we should run MDNS on it.

Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
David Scott 2016-04-16 19:35:18 +01:00
parent 6ca504f192
commit 1477dee600

View File

@ -17,11 +17,16 @@ start()
hostname -F /etc/hostname
export HOSTNAME=$(hostname -s).local.
INTF=eth0
if [ "$(mobyconfig get network)" = "hybrid" ]; then
INTF=eth1
fi
start-stop-daemon --start --quiet \
--background \
--exec /sbin/mdnstool \
--make-pidfile --pidfile ${PIDFILE} \
-- -if eth0 -hostname ${HOSTNAME}
-- -if ${INTF} -hostname ${HOSTNAME}
eend $? "Failed to start mDNS server"
}