From e85dd190929cbaa0ec92622cefb2c9f79d212454 Mon Sep 17 00:00:00 2001 From: Tarun Sukhani Date: Thu, 12 Feb 2026 09:53:28 +0800 Subject: [PATCH] updated killmode to mixed --- src/daemon/systemd-unit.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/daemon/systemd-unit.ts b/src/daemon/systemd-unit.ts index f947d4e2be8..7dc1b948bef 100644 --- a/src/daemon/systemd-unit.ts +++ b/src/daemon/systemd-unit.ts @@ -49,10 +49,12 @@ export function buildSystemdUnit({ `ExecStart=${execStart}`, "Restart=always", "RestartSec=5", - // KillMode=process ensures systemd only waits for the main process to exit. - // Without this, podman's conmon (container monitor) processes block shutdown - // since they run as children of the gateway and stay in the same cgroup. - "KillMode=process", + // KillMode=mixed sends SIGTERM to the main process for graceful shutdown, + // then SIGKILL to all remaining cgroup processes (orphaned children like + // podman conmon, headless chrome, etc.) after TimeoutStopSec. + // Using "process" here would leave the gateway child alive across restarts, + // causing port conflicts. + "KillMode=mixed", workingDirLine, ...envLines, "",