From e229dbc86aa50d01683c640987f27511fd863bad Mon Sep 17 00:00:00 2001 From: MohammadErfan Jabbari Date: Tue, 27 Jan 2026 18:35:26 +0100 Subject: [PATCH] fix(daemon): use correct service name for node install/uninstall installSystemdService and uninstallSystemdService were hardcoded to use resolveGatewaySystemdServiceName() instead of resolveSystemdServiceName(), which respects the CLAWDBOT_SYSTEMD_UNIT environment variable override. This caused 'clawdbot node install' to fail because: 1. The correct unit file was created (e.g., clawdbot-node.service) 2. But systemctl tried to enable 'clawdbot-gateway.service' instead Fixes #2855 Co-Authored-By: Claude Opus 4.5 --- src/daemon/systemd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/daemon/systemd.ts b/src/daemon/systemd.ts index 7a28304f3..e92295be2 100644 --- a/src/daemon/systemd.ts +++ b/src/daemon/systemd.ts @@ -213,7 +213,7 @@ export async function installSystemdService({ }); await fs.writeFile(unitPath, unit, "utf8"); - const serviceName = resolveGatewaySystemdServiceName(env.CLAWDBOT_PROFILE); + const serviceName = resolveSystemdServiceName(env); const unitName = `${serviceName}.service`; const reload = await execSystemctl(["--user", "daemon-reload"]); if (reload.code !== 0) { @@ -244,7 +244,7 @@ export async function uninstallSystemdService({ stdout: NodeJS.WritableStream; }): Promise { await assertSystemdAvailable(); - const serviceName = resolveGatewaySystemdServiceName(env.CLAWDBOT_PROFILE); + const serviceName = resolveSystemdServiceName(env); const unitName = `${serviceName}.service`; await execSystemctl(["--user", "disable", "--now", unitName]);