healthcheck: List udp ports with ss

Looks like octavia healthmanager uses UDP 5555 port.

Also changes octavia-health-manager healath check to use
healthcheck_port rather than healthcheck_listen, as udp
is a connectionless protocol.

Change-Id: Id48d5efe17eeb1a524e280d8885e98cfe1a5577a
Related-Bug: #1843555
This commit is contained in:
Rabi Mishra 2019-09-13 13:26:16 +05:30
parent a27e7f04be
commit 0ca91f0d14
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ healthcheck_port () {
# port by using "sudo -u" to get the right output. # port by using "sudo -u" to get the right output.
# Note: the privileged containers have the correct ss output with root # Note: the privileged containers have the correct ss output with root
# user; which is why we need to run with both users, as a best effort. # user; which is why we need to run with both users, as a best effort.
(ss -ntp; sudo -u $puser ss -ntp) | sort -u | grep -qE ":($ports).*,pid=($pids)," (ss -ntuap; sudo -u $puser ss -ntuap) | sort -u | grep -qE ":($ports).*,pid=($pids),"
} }
healthcheck_listen () { healthcheck_listen () {

View File

@ -5,7 +5,7 @@
process='octavia-health-manager' process='octavia-health-manager'
args="${@:-5555}" args="${@:-5555}"
if healthcheck_listen $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}