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:
Fabiano Correa Mercer 2024-08-06 17:43:13 -03:00
parent 18254c31d6
commit a08d8bca0b

View File

@ -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,7 +15,13 @@ 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
# 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=""
@ -32,7 +40,8 @@ case "$1" in
done
if [ -z "${ipv4_result}" ] && [ -z "${ipv6_result}" ];
then
echo "$NAME did not provide name resolution in 20s after starting. Continuing...."
echo "$NAME did not provide name resolution in $DNSMASQ_TIMEOUT seconds after starting. Continuing...."
fi
fi
echo -n "Refresh hosts cache"
nscd -i hosts