From 3bf18605dbe48dda910e93b9b17f5d9888b376dd Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 18 Jun 2026 17:34:56 +0000 Subject: [PATCH] fix(deploy): bound service stop so restarts can't hang systemctl restart was hanging indefinitely: lyra-web's long-lived SSE log streams block uvicorn's graceful shutdown forever. Add TimeoutStopSec=10 + KillMode=mixed to both units so stop is bounded (SIGTERM, then SIGKILL the cgroup) and restart always completes. Co-Authored-By: Claude Opus 4.8 (1M context) --- deploy/lyra-dream.service | 3 ++- deploy/lyra-web.service | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/lyra-dream.service b/deploy/lyra-dream.service index ff9b4c4..d6c43c1 100644 --- a/deploy/lyra-dream.service +++ b/deploy/lyra-dream.service @@ -5,11 +5,12 @@ Documentation=https://github.com/serversdown/project-lyra [Service] Type=simple WorkingDirectory=/home/serversdown/project-lyra -# Clear any stray VIRTUAL_ENV so uv resolves the project's own .venv. UnsetEnvironment=VIRTUAL_ENV ExecStart=/home/serversdown/.local/bin/uv run lyra-dream --loop 1800 Restart=on-failure RestartSec=30 +TimeoutStopSec=10 +KillMode=mixed [Install] WantedBy=default.target diff --git a/deploy/lyra-web.service b/deploy/lyra-web.service index 9df6cf5..b508fb7 100644 --- a/deploy/lyra-web.service +++ b/deploy/lyra-web.service @@ -8,6 +8,8 @@ UnsetEnvironment=VIRTUAL_ENV ExecStart=/home/serversdown/.local/bin/uv run lyra-web Restart=on-failure RestartSec=5 +TimeoutStopSec=10 +KillMode=mixed [Install] WantedBy=default.target