fix: improve WSL2 systemd daemon hints
This commit is contained in:
25
src/daemon/systemd-hints.ts
Normal file
25
src/daemon/systemd-hints.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export function isSystemdUnavailableDetail(detail?: string): boolean {
|
||||
if (!detail) return false;
|
||||
const normalized = detail.toLowerCase();
|
||||
return (
|
||||
normalized.includes("systemctl --user unavailable") ||
|
||||
normalized.includes("systemctl not available") ||
|
||||
normalized.includes("not been booted with systemd") ||
|
||||
normalized.includes("failed to connect to bus") ||
|
||||
normalized.includes("systemd user services are required")
|
||||
);
|
||||
}
|
||||
|
||||
export function renderSystemdUnavailableHints(options: { wsl?: boolean } = {}): string[] {
|
||||
if (options.wsl) {
|
||||
return [
|
||||
"WSL2 needs systemd enabled: edit /etc/wsl.conf with [boot]\\nsystemd=true",
|
||||
"Then run: wsl --shutdown (from PowerShell) and reopen your distro.",
|
||||
"Verify: systemctl --user status",
|
||||
];
|
||||
}
|
||||
return [
|
||||
"systemd user services are unavailable; install/enable systemd or run the gateway under your supervisor.",
|
||||
"If you're in a container, run the gateway in the foreground instead of `clawdbot daemon`.",
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user