mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 07:20:22 +00:00
Daemon: scope relaxed systemd probes to install flows
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user