{"record":{"id":"18fb87b47ba872d6","repo":"zeroclaw-labs/zeroclaw","slug":"systemd-user-lingering-disabled-user-service-may","errorCode":null,"errorMessage":"systemd user lingering disabled; user service may stop after logout. Enable with: loginctl enable-linger {$user}","messagePattern":"systemd user lingering disabled; user service may stop after logout\\. Enable with: loginctl enable-linger (.+?)","errorType":"console","errorClass":"DiagItem","httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-runtime/src/doctor/mod.rs","lineNumber":1761,"sourceCode":"\n    // Optional tools\n    check_command_available(\"curl\", &[\"--version\"], cat, items);\n\n    if crate::service::linux_systemd_runtime_present() {\n        items.push(systemd_linger_diag_item(\n            crate::service::systemd_user_linger_status(),\n        ));\n    }\n}\n\nfn systemd_linger_diag_item(status: crate::service::SystemdUserLinger) -> DiagItem {\n    let cat = \"environment\";\n    match status {\n        crate::service::SystemdUserLinger::Enabled => DiagItem::ok(\n            cat,\n            crate::i18n::get_required_cli_string(\"cli-doctor-systemd-linger-enabled\"),\n        ),\n        crate::service::SystemdUserLinger::Disabled { user } => DiagItem::warn(\n            cat,\n            crate::i18n::get_required_cli_string_with_args(\n                \"cli-doctor-systemd-linger-disabled\",\n                &[(\"user\", user.as_str())],\n            ),\n        ),\n        crate::service::SystemdUserLinger::Unknown => DiagItem::warn(\n            cat,\n            crate::i18n::get_required_cli_string(\"cli-doctor-systemd-linger-unknown\"),\n        ),\n    }\n}\n\nfn check_cli_tools(items: &mut Vec<DiagItem>) {\n    let cat = \"cli-tools\";\n\n    let discovered = crate::tools::discover_cli_tools(&[], &[]);\n","sourceCodeStart":1743,"sourceCodeEnd":1779,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/doctor/mod.rs#L1743-L1779","documentation":"A `zeroclaw doctor` warning from `systemd_linger_diag_item` (via `check_environment`, only when a systemd user runtime is present): systemd user lingering is disabled for the current user. Without lingering, the user manager (and the zeroclaw user service inside it) is stopped at logout, so an unattended daemon dies with your session. The localized message includes the exact fix: `loginctl enable-linger <user>`.","triggerScenarios":"Running `zeroclaw doctor` on a Linux host with systemd where `loginctl show-user <user>` reports lingering disabled — the common state after installing zeroclaw as a user service for the first time.","commonSituations":"Daemon installed via `zeroclaw service install` on a fresh machine; SSH-based setups where the admin logs out expecting the bot to keep running; shared servers where linger was never enabled.","solutions":["Run `loginctl enable-linger <user>` (the message names your user) so the user manager survives logout.","Restart the zeroclaw user service afterwards and log out/in to verify it stays up.","Re-run `zeroclaw doctor` and confirm the linger item reports enabled (ok)."],"exampleFix":"# before: doctor warns lingering disabled for user alice\n\n# after\nloginctl enable-linger alice\nsystemctl --user restart zeroclaw","handlingStrategy":"validation","validationCode":"match zeroclaw_runtime::service::systemd_user_linger_status() {\n    zeroclaw_runtime::service::SystemdUserLinger::Disabled { user } => {\n        eprintln!(\"run: loginctl enable-linger {user}\");\n    }\n    _ => {}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make `loginctl enable-linger <user>` part of the service-install checklist.","After enabling linger, verify the service survives logout once before relying on it."],"tags":["environment","systemd","service","doctor","linux","zeroclaw"],"backgroundTag":"systemd-user-service-stops","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}