From b8e4b32a3338207c8cc807a8651f60ab6b923727 Mon Sep 17 00:00:00 2001 From: Kevin Janssen Date: Wed, 18 Nov 2026 10:27:59 +0100 Subject: [PATCH] Wait for the Linux service launcher to execute its verified binary --- tools/dev_linux_helper_rollover.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/dev_linux_helper_rollover.py b/tools/dev_linux_helper_rollover.py index 25b082e..6424852 100644 --- a/tools/dev_linux_helper_rollover.py +++ b/tools/dev_linux_helper_rollover.py @@ -172,8 +172,12 @@ def device(args, activate): replace(UNIT, unit) run('systemctl', 'daemon-reload') run('systemctl', 'start', UNIT.name, AGENT) + # The agent unit starts its Python launcher before exec'ing the signed binary. + deadline = time.monotonic() + 15 for service, expected in [(UNIT.name, destination/'helper'), (AGENT, new/'agent')]: - require(process_image(service) == expected, 'Unexpected running binary') + while process_image(service) != expected: + require(time.monotonic() < deadline, f'{service} did not start its verified binary') + time.sleep(0.2) return dict(binding=binding, version=manifest['version'], previous=[old_hash, source[2]['policy_sha256']], current=[new_hash, target[2]['policy_sha256']])