mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 09:11:12 +00:00
refactor(restart): extract stale pid cleanup and supervisor markers
This commit is contained in:
20
src/infra/supervisor-markers.ts
Normal file
20
src/infra/supervisor-markers.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export const SUPERVISOR_HINT_ENV_VARS = [
|
||||
// macOS launchd
|
||||
"LAUNCH_JOB_LABEL",
|
||||
"LAUNCH_JOB_NAME",
|
||||
// OpenClaw service env markers
|
||||
"OPENCLAW_LAUNCHD_LABEL",
|
||||
"OPENCLAW_SYSTEMD_UNIT",
|
||||
"OPENCLAW_SERVICE_MARKER",
|
||||
// Linux systemd
|
||||
"INVOCATION_ID",
|
||||
"SYSTEMD_EXEC_PID",
|
||||
"JOURNAL_STREAM",
|
||||
] as const;
|
||||
|
||||
export function hasSupervisorHint(env: NodeJS.ProcessEnv = process.env): boolean {
|
||||
return SUPERVISOR_HINT_ENV_VARS.some((key) => {
|
||||
const value = env[key];
|
||||
return typeof value === "string" && value.trim().length > 0;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user