fix(daemon): honor launchd running state without pid

This commit is contained in:
Peter Steinberger
2026-04-10 21:30:07 +01:00
parent 1f80ebf643
commit f3c143f0cd
2 changed files with 21 additions and 1 deletions

View File

@@ -519,7 +519,10 @@ async function probeLaunchAgentState(serviceTarget: string): Promise<LaunchAgent
};
}
const runtime = parseLaunchctlPrint(probe.stdout || probe.stderr || "");
if (typeof runtime.pid === "number" && runtime.pid > 1) {
if (
normalizeLowercaseStringOrEmpty(runtime.state) === "running" ||
(typeof runtime.pid === "number" && runtime.pid > 1)
) {
return { state: "running" };
}
return { state: "stopped" };