Handle transient observer lock contention and renew diagnostic sudo
This commit is contained in:
parent
9edfcf0917
commit
51d367d226
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue