Do not check FQDN during ctrl1 upgrade
During the USM AIO-DX upgrade, it is necessary to swact to controller-1 to continue the process. The dnsmasq.service attempts to resolve controller.internal to ensure dnsmasq is running and to prevent SM from starting dependent services that will attempt to use controller.internal. While this approach worked initially, it affected the upgrade process because the dnsmasq.addn_hosts file created by the previous release does not include controller.internal. As a result, the dnsmasq.service used up all its retries (20 seconds), causing the SM to fail the swact to controller-1 due to a timeout. To fix this, the dnsmasq.service will not resolve controller.internal during the controller-1 upgrade. Test done: AIO-DX fresh install AIO-DX swact to/from controller-1 AIO-DX USM upgrade Story: 2010722 Task: 50762 Change-Id: I25211d58c7e952589a10d4760cc3e4b11250c96d Signed-off-by: Fabiano Correa Mercer <fabiano.correamercer@windriver.com>
This commit is contained in:
parent
18254c31d6
commit
a08d8bca0b
@ -3,6 +3,8 @@ DAEMON=/usr/sbin/dnsmasq
|
||||
NAME=dnsmasq
|
||||
DESC="DNS forwarder and DHCP server"
|
||||
PIDFILE="/var/run/dnsmasq.pid"
|
||||
DNSMASQ_TIMEOUT=10
|
||||
CTRL1_FQDN_FLAG="/etc/platform/.upgrade_do_not_use_fqdn"
|
||||
|
||||
test -f $DAEMON || exit 0
|
||||
|
||||
@ -13,26 +15,33 @@ case "$1" in
|
||||
start-stop-daemon -S -x $DAEMON --pidfile $PIDFILE -- $ARGS
|
||||
echo "done."
|
||||
# DNS is just ready when it can resolve controller.internal
|
||||
let -i UNTIL=$SECONDS+20
|
||||
domain="controller.internal"
|
||||
ipv4_result=""
|
||||
ipv6_result=""
|
||||
while [ $UNTIL -ge $SECONDS ]
|
||||
do
|
||||
ipv4_result=$(dig +short ${domain})
|
||||
ipv6_result=$(dig AAAA +short ${domain})
|
||||
# Check to see if DNS is ready
|
||||
if [ -n "${ipv4_result}" ] || [ -n "${ipv6_result}" ];
|
||||
# but ignore this test during controller-1 upgrade since
|
||||
# the dnsmasq.addn_hosts was created by previous code without
|
||||
# the controller.internal entry
|
||||
# TODO<fcorream> remove the flag CTRL1_FQDN_FLAG for future
|
||||
# releases
|
||||
if [ ! -f "${CTRL1_FQDN_FLAG}" ]; then
|
||||
let -i UNTIL=$SECONDS+$DNSMASQ_TIMEOUT
|
||||
domain="controller.internal"
|
||||
ipv4_result=""
|
||||
ipv6_result=""
|
||||
while [ $UNTIL -ge $SECONDS ]
|
||||
do
|
||||
ipv4_result=$(dig +short ${domain})
|
||||
ipv6_result=$(dig AAAA +short ${domain})
|
||||
# Check to see if DNS is ready
|
||||
if [ -n "${ipv4_result}" ] || [ -n "${ipv6_result}" ];
|
||||
then
|
||||
echo "$NAME is operational."
|
||||
break
|
||||
fi
|
||||
# Check every second
|
||||
sleep 1
|
||||
done
|
||||
if [ -z "${ipv4_result}" ] && [ -z "${ipv6_result}" ];
|
||||
then
|
||||
echo "$NAME is operational."
|
||||
break
|
||||
echo "$NAME did not provide name resolution in $DNSMASQ_TIMEOUT seconds after starting. Continuing...."
|
||||
fi
|
||||
# Check every second
|
||||
sleep 1
|
||||
done
|
||||
if [ -z "${ipv4_result}" ] && [ -z "${ipv6_result}" ];
|
||||
then
|
||||
echo "$NAME did not provide name resolution in 20s after starting. Continuing...."
|
||||
fi
|
||||
echo -n "Refresh hosts cache"
|
||||
nscd -i hosts
|
||||
|
Loading…
x
Reference in New Issue
Block a user