Handle transient observer lock contention and renew diagnostic sudo

This commit is contained in:
Pavel Isaev 2026-11-08 23:25:04 +03:00
parent 9edfcf0917
commit 51d367d226

View file

@ -108,6 +108,12 @@ PY
journalctl -u archipelagod.service -n 80 --no-pager
"""
try:
# Long operations can outlive sudo's credential timestamp.
child.sendline("sudo -v")
prompt = child.expect([r"\[sudo\] password for coretest:", r"coretest@.*[\$] "], timeout=30)
if prompt == 0:
child.sendline(password)
child.expect(r"coretest@.*[\$] ", timeout=30)
child.sendline("sudo /bin/bash -c " + shlex.quote(diagnostic) +
"; printf '\\n__ARCHIPELAGO_DIAGNOSTICS_DONE__\\n'")
child.expect(r"\r?\n__ARCHIPELAGO_DIAGNOSTICS_DONE__\r?\n", timeout=120)