diff --git a/CHANGELOG.md b/CHANGELOG.md index 14a727498..ee10954a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ ### Fixes - Onboarding: resolve CLI entrypoint when running via `npx` so gateway daemon install works without a build step. -- Linux: prompt to enable systemd lingering when installing/restarting the gateway user service (prevents logout/idle shutdowns). +- Linux: auto-attempt lingering during onboarding (try without sudo, fallback to sudo) and prompt on install/restart to keep the gateway alive after logout/idle. Thanks @tobiasbischoff for PR #237. - TUI: migrate key handling to the updated pi-tui Key matcher API. - macOS: prefer gateway config reads/writes in local mode (fall back to disk if the gateway is unavailable). - macOS: local gateway now connects via tailnet IP when bind mode is `tailnet`/`auto`. diff --git a/docs/faq.md b/docs/faq.md index 163a5f51d..d59caef6a 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -471,7 +471,7 @@ codex --full-auto "debug why clawdbot gateway won't start" Linux installs use a systemd **user** service. By default, systemd stops user services on logout/idle, which kills the Gateway. -Fix: +Onboarding attempts to enable lingering; if it’s still off, run: ```bash sudo loginctl enable-linger $USER ``` diff --git a/docs/gateway.md b/docs/gateway.md index 8b53b38fd..f278f4756 100644 --- a/docs/gateway.md +++ b/docs/gateway.md @@ -182,7 +182,7 @@ Enable lingering (required so the user service survives logout/idle): ``` sudo loginctl enable-linger youruser ``` -Requires sudo (writes `/var/lib/systemd/linger`). +Onboarding runs this on Linux (may prompt for sudo; writes `/var/lib/systemd/linger`). Then enable the service: ``` systemctl --user enable --now clawdbot-gateway.service @@ -190,9 +190,10 @@ systemctl --user enable --now clawdbot-gateway.service **Alternative (system service)** - for always-on or multi-user servers, you can install a systemd **system** unit instead of a user unit (no lingering needed). -Create `/etc/systemd/system/clawdbot-gateway.service`, set `User=` and -`WorkingDirectory=`, then enable with: +Create `/etc/systemd/system/clawdbot-gateway.service` (copy the unit above, +switch `WantedBy=multi-user.target`, set `User=` + `WorkingDirectory=`), then: ``` +sudo systemctl daemon-reload sudo systemctl enable --now clawdbot-gateway.service ``` diff --git a/docs/setup.md b/docs/setup.md index 5a580df8f..d053da7e3 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -112,7 +112,8 @@ pnpm clawdbot health ## Linux (systemd user service) Linux installs use a systemd **user** service. By default, systemd stops user -services on logout/idle, which kills the Gateway. Enable lingering: +services on logout/idle, which kills the Gateway. Onboarding attempts to enable +lingering for you (may prompt for sudo). If it’s still off, run: ```bash sudo loginctl enable-linger $USER diff --git a/docs/wizard.md b/docs/wizard.md index ae10f3785..1682cf9ec 100644 --- a/docs/wizard.md +++ b/docs/wizard.md @@ -74,8 +74,8 @@ It does **not** install or change anything on the remote host. - macOS: LaunchAgent - Requires a logged-in user session; for headless, use a custom LaunchDaemon (not shipped). - Linux: systemd user unit - - Wizard enables lingering via `loginctl enable-linger ` so the Gateway stays up after logout. - - Requires sudo (writes `/var/lib/systemd/linger`). + - Wizard attempts to enable lingering via `loginctl enable-linger ` so the Gateway stays up after logout. + - May prompt for sudo (writes `/var/lib/systemd/linger`); it tries without sudo first. - Windows: Scheduled Task - Runs on user logon; headless/system services are not configured by default.