fix(daemon): handle systemctl is-enabled exit 4 (not-found) on Ubuntu (#33634)

Merged via squash.

Prepared head SHA: 67dffc3ee2
Co-authored-by: Yuandiaodiaodiao <33371662+Yuandiaodiaodiao@users.noreply.github.com>
Co-authored-by: shakkernerd <165377636+shakkernerd@users.noreply.github.com>
Reviewed-by: @shakkernerd
This commit is contained in:
a
2026-03-05 00:13:45 +08:00
committed by GitHub
parent 3fa43ec221
commit 4fb40497d4
4 changed files with 22 additions and 3 deletions

View File

@@ -143,7 +143,10 @@ async function execSystemctl(
}
function readSystemctlDetail(result: { stdout: string; stderr: string }): string {
return (result.stderr || result.stdout || "").trim();
// Concatenate both streams so pattern matchers (isSystemdUnitNotEnabled,
// isSystemctlMissing) can see the unit status from stdout even when
// execFileUtf8 populates stderr with the Node error message fallback.
return `${result.stderr} ${result.stdout}`.trim();
}
function isSystemctlMissing(detail: string): boolean {