Skip to content

Commit

Permalink
Increase debugging for blocked port 749 and 464
Browse files Browse the repository at this point in the history
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 <cheimes@redhat.com>
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
  • Loading branch information
tiran authored and Tiboris committed Nov 29, 2018
1 parent 7690030 commit 0e3a9f6
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions ipatests/pytest_ipa/integration/tasks.py
Expand Up @@ -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:
Expand Down

0 comments on commit 0e3a9f6

Please sign in to comment.