Use port 547 for dhcpv6 healthchecks when using IPv6

Check the listen-address to determine if using IPv6 on
the ctlplane and set the DHCP port accordingly.

Change-Id: I5602aa1298dda998b9a58f7234593683281414c3
Closes-Bug: 1847380
(cherry picked from commit 6b3b39f695)
This commit is contained in:
Bob Fournier 2019-10-15 20:35:19 -04:00
parent d384320b13
commit e1f322af47
1 changed files with 10 additions and 3 deletions

View File

@ -4,9 +4,16 @@
process='dnsmasq'
if pgrep $process; then
ports="${@:-67}"
if ! healthcheck_listen $process $ports; then
echo "There is no $process process listening on port(s) $ports in the container."
listen_address=$(get_config_val /etc/ironic-inspector/inspector.conf DEFAULT listen_address 127.0.0.1)
# Check DHCPv6 port if using IPv6
if [[ $listen_address =~ ":" ]]; then
port="547"
else
port="67"
fi
echo "Checking $process port(s) $port."
if ! healthcheck_listen $process $port; then
echo "There is no $process process listening on port(s) $port in the container."
exit 1
fi
else