Daemon: scope relaxed systemd probes to install flows

This commit is contained in:
Vincent Koc
2026-03-07 16:45:18 -08:00
parent fcb990e369
commit 0d66834f94
6 changed files with 102 additions and 19 deletions

View File

@@ -309,6 +309,15 @@ function isGenericSystemctlIsEnabledFailure(detail: string): boolean {
);
}
export function isNonFatalSystemdInstallProbeError(error: unknown): boolean {
const detail = error instanceof Error ? error.message : typeof error === "string" ? error : "";
if (!detail) {
return false;
}
const normalized = detail.toLowerCase();
return isSystemctlBusUnavailable(normalized) || isGenericSystemctlIsEnabledFailure(normalized);
}
function resolveSystemctlDirectUserScopeArgs(): string[] {
return ["--user"];
}
@@ -569,12 +578,7 @@ export async function isSystemdServiceEnabled(args: GatewayServiceEnvArgs): Prom
return true;
}
const detail = readSystemctlDetail(res);
if (
isSystemctlMissing(detail) ||
isSystemdUnitNotEnabled(detail) ||
isSystemctlBusUnavailable(detail) ||
isGenericSystemctlIsEnabledFailure(detail)
) {
if (isSystemctlMissing(detail) || isSystemdUnitNotEnabled(detail)) {
return false;
}
throw new Error(`systemctl is-enabled unavailable: ${detail || "unknown error"}`.trim());