diff --git a/gateway/restart.py b/gateway/restart.py index d6aef06653..1a24fcac58 100644 --- a/gateway/restart.py +++ b/gateway/restart.py @@ -2,7 +2,9 @@ import math import os -from collections.abc import Mapping +import re +import subprocess +from collections.abc import Callable, Mapping from hermes_cli.config import DEFAULT_CONFIG @@ -55,6 +57,128 @@ CRON_DRAIN_CLEANUP_RESERVE_S = 10.0 SYSTEMD_STOP_HEADROOM_S = 30.0 SYSTEMD_TIMEOUT_STOP_SEC_FLOOR = 60.0 +# launchd is the one supervisor whose stop budget the gateway cannot size: +# ``ExitTimeOut`` lives in the plist, and the per-user (gui) domain CLAMPS +# it — measured on macOS 26.6.1: plist 215 -> live 60, 90 -> 60, 60 -> 60, +# 30 -> 30. The gateway can only *read* the live value (``launchctl print +# gui//