From 3243498faa19eeba01fc87586a3d6fbcd81a4fa3 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 26 Nov 2018 12:31:20 +0100 Subject: [PATCH] Increase debugging for blocked port 749 and 464 kadmin.service is still failing to start sometimes. List and check both source and destination ports of listening and non-listening TCP and UDP sockets. See: https://pagure.io/freeipa/issue/7769 Signed-off-by: Christian Heimes Reviewed-By: Thomas Woerner --- ipatests/pytest_ipa/integration/tasks.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/ipatests/pytest_ipa/integration/tasks.py b/ipatests/pytest_ipa/integration/tasks.py index f79348e30..843e07781 100644 --- a/ipatests/pytest_ipa/integration/tasks.py +++ b/ipatests/pytest_ipa/integration/tasks.py @@ -161,15 +161,29 @@ def prepare_host(host): def rpcbind_kadmin_workaround(host): - """Restart rpcbind in case it blocks 749/UDP + """Restart rpcbind in case it blocks 749/TCP, 464/UDP, or 464/TCP See https://pagure.io/freeipa/issue/7769 See https://bugzilla.redhat.com/show_bug.cgi?id=1592883 """ + cmd = [ + 'ss', + '--all', # listening and non-listening sockets + '--tcp', '--udp', # only TCP and UDP sockets + '--numeric', # don't resolve host and service names + '--processes', # show processes + ] + # run once to list all ports for debugging + host.run_command(cmd) + # check for blocked kadmin port + cmd.extend(( + '-o', 'state', 'all', # ports in any state, not just listening + '( sport = :749 or dport = :749 or sport = :464 or dport = :464 )' + )) for _i in range(5): - result = host.run_command(['ss', '-ulnp', 'sport', '=', '749']) + result = host.run_command(cmd) if 'rpcbind' in result.stdout_text: - logger.error("rpcbind blocks 749/UDP, restarting service") + logger.error("rpcbind blocks 749, restarting") host.run_command(['systemctl', 'restart', 'rpcbind.service']) time.sleep(2) else: