fix: improve WSL2 systemd daemon hints

This commit is contained in:
Peter Steinberger
2026-01-17 18:19:47 +00:00
parent 408f4f2dac
commit 8a67d29748
10 changed files with 110 additions and 36 deletions

View File

@@ -12,7 +12,10 @@ import {
} from "../daemon/runtime-paths.js";
import { resolveGatewayService } from "../daemon/service.js";
import { buildServiceEnvironment } from "../daemon/service-env.js";
import { isSystemdUserServiceAvailable } from "../daemon/systemd.js";
import { renderSystemdUnavailableHints } from "../daemon/systemd-hints.js";
import { formatPortDiagnostics, inspectPortUsage } from "../infra/ports.js";
import { isWSL } from "../infra/wsl.js";
import type { RuntimeEnv } from "../runtime.js";
import { note } from "../terminal/note.js";
import { sleep } from "../utils.js";
@@ -55,6 +58,14 @@ export async function maybeRepairGatewayDaemon(params: {
}
if (!loaded) {
if (process.platform === "linux") {
const systemdAvailable = await isSystemdUserServiceAvailable().catch(() => false);
if (!systemdAvailable) {
const wsl = await isWSL();
note(renderSystemdUnavailableHints({ wsl }).join("\n"), "Gateway");
return;
}
}
note("Gateway daemon not installed.", "Gateway");
if (params.cfg.gateway?.mode !== "remote") {
const install = await params.prompter.confirmSkipInNonInteractive({