zeroclaw-labs/zeroclaw · warning · DiagItem
systemd user lingering could not be checked with loginctl
Error message
systemd user lingering could not be checked with loginctl
What it means
A `zeroclaw doctor` warning from `systemd_linger_diag_item`: the linger check returned `SystemdUserLinger::Unknown`, meaning `loginctl` could not answer (binary missing, no user session bus, or a non-standard systemd setup). Doctor cannot decide whether the user service will survive logout, so it warns rather than guessing.
Source
Thrown at crates/zeroclaw-runtime/src/doctor/mod.rs:1768
));
}
}
fn systemd_linger_diag_item(status: crate::service::SystemdUserLinger) -> DiagItem {
let cat = "environment";
match status {
crate::service::SystemdUserLinger::Enabled => DiagItem::ok(
cat,
crate::i18n::get_required_cli_string("cli-doctor-systemd-linger-enabled"),
),
crate::service::SystemdUserLinger::Disabled { user } => DiagItem::warn(
cat,
crate::i18n::get_required_cli_string_with_args(
"cli-doctor-systemd-linger-disabled",
&[("user", user.as_str())],
),
),
crate::service::SystemdUserLinger::Unknown => DiagItem::warn(
cat,
crate::i18n::get_required_cli_string("cli-doctor-systemd-linger-unknown"),
),
}
}
fn check_cli_tools(items: &mut Vec<DiagItem>) {
let cat = "cli-tools";
let discovered = crate::tools::discover_cli_tools(&[], &[]);
if discovered.is_empty() {
items.push(DiagItem::warn(cat, "No CLI tools found in PATH"));
} else {
for cli in &discovered {
let version_info = cli
.version
.as_deref()View on GitHub (pinned to 88bb9c8533)
Solutions
- Verify `loginctl` is installed and on PATH (`command -v loginctl`).
- If running in a container or non-systemd environment, treat this warning as expected and rely on the container supervisor for lifecycle.
- On real systemd hosts, check the user session bus (`systemctl --user status`) and dbus-user-session package, then re-run `zeroclaw doctor`.
Defensive patterns
Strategy: fallback
Try / catch
match zeroclaw_runtime::service::systemd_user_linger_status() {
zeroclaw_runtime::service::SystemdUserLinger::Unknown => {
// no loginctl answer: treat lifecycle as container/supervisor-managed, not an error
}
other => { /* handle Enabled/Disabled as usual */ }
} Prevention
- In containers, let the container supervisor own lifecycle and skip systemd linger expectations.
- Install `loginctl` (systemd package) plus dbus-user-session where systemd user services are intended.
When it happens
Trigger: Running `zeroclaw doctor` on a host where `systemd_user_linger_status()` cannot complete: `loginctl` absent from PATH, D-Bus user session not available, containers, WSL1, or init systems that are not systemd despite `/run/systemd` hints.
Common situations: Docker/Podman containers with a partial systemd userland; chroot or minimal VMs; broken polkit/dbus setups; SSH sessions without a user session bus.
Related errors
- neither $SHELL nor %ComSpec% is set
- systemd user lingering disabled; user service may stop after
- No CLI tools found in PATH
- {cmd} found but returned non-zero
- {cmd} not found in PATH
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/3f94a1805124dae4.
Report an issue: GitHub.