refactor(daemon): share service description resolve

This commit is contained in:
Peter Steinberger
2026-02-16 00:36:43 +00:00
parent 58cf37ceeb
commit 0dbc51aa55
5 changed files with 41 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ import type { GatewayServiceRuntime } from "./service-runtime.js";
import {
formatGatewayServiceDescription,
LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES,
resolveGatewayServiceDescription,
resolveGatewaySystemdServiceName,
} from "./constants.js";
import { execFileUtf8 } from "./exec-file.js";
@@ -200,12 +201,7 @@ export async function installSystemdService({
const unitPath = resolveSystemdUnitPath(env);
await fs.mkdir(path.dirname(unitPath), { recursive: true });
const serviceDescription =
description ??
formatGatewayServiceDescription({
profile: env.OPENCLAW_PROFILE,
version: environment?.OPENCLAW_SERVICE_VERSION ?? env.OPENCLAW_SERVICE_VERSION,
});
const serviceDescription = resolveGatewayServiceDescription({ env, environment, description });
const unit = buildSystemdUnit({
description: serviceDescription,
programArguments,