fix: improve WSL2 systemd daemon hints
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { resolveIsNixMode } from "../../config/paths.js";
|
||||
import { resolveGatewayService } from "../../daemon/service.js";
|
||||
import { isSystemdUserServiceAvailable } from "../../daemon/systemd.js";
|
||||
import { renderSystemdUnavailableHints } from "../../daemon/systemd-hints.js";
|
||||
import { isWSL } from "../../infra/wsl.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { buildDaemonServiceSnapshot, createNullWriter, emitDaemonActionJson } from "./response.js";
|
||||
import { renderGatewayServiceStartHints } from "./shared.js";
|
||||
@@ -89,7 +92,13 @@ export async function runDaemonStart(opts: DaemonLifecycleOptions = {}) {
|
||||
return;
|
||||
}
|
||||
if (!loaded) {
|
||||
const hints = renderGatewayServiceStartHints();
|
||||
let hints = renderGatewayServiceStartHints();
|
||||
if (process.platform === "linux") {
|
||||
const systemdAvailable = await isSystemdUserServiceAvailable().catch(() => false);
|
||||
if (!systemdAvailable) {
|
||||
hints = [...hints, ...renderSystemdUnavailableHints({ wsl: await isWSL() })];
|
||||
}
|
||||
}
|
||||
emit({
|
||||
ok: true,
|
||||
result: "not-loaded",
|
||||
@@ -229,7 +238,13 @@ export async function runDaemonRestart(opts: DaemonLifecycleOptions = {}): Promi
|
||||
return false;
|
||||
}
|
||||
if (!loaded) {
|
||||
const hints = renderGatewayServiceStartHints();
|
||||
let hints = renderGatewayServiceStartHints();
|
||||
if (process.platform === "linux") {
|
||||
const systemdAvailable = await isSystemdUserServiceAvailable().catch(() => false);
|
||||
if (!systemdAvailable) {
|
||||
hints = [...hints, ...renderSystemdUnavailableHints({ wsl: await isWSL() })];
|
||||
}
|
||||
}
|
||||
emit({
|
||||
ok: true,
|
||||
result: "not-loaded",
|
||||
|
||||
Reference in New Issue
Block a user