Repository navigation
Description
What happens
On a Linux host without polkit, agentop setup installs Cortex, reports it ready, and leaves lingering off. Cortex then stops at the user's next logout, on exactly the kind of box lingering is for: headless, SSH-only.
Reproduced on Debian 13 (trixie, systemd 257.13, arm64), installed with only "SSH server" selected. That install does not include polkitd.
✓ started systemd user unit · healthy on 127.0.0.1:47600
loaded, but `loginctl enable-linger` failed: the service will stop when you log out. Ask an administrator to run: loginctl enable-linger $USER
cortex main-ee8623d ready.
Why
An unprivileged loginctl enable-linger is authorized by polkit. logind asks it about org.freedesktop.login1.set-self-linger (method_set_user_linger in src/login/logind-dbus.c), and systemd's own policy allows that for any user, with no password. But only polkitd reads that policy, and it is a separate package that systemd merely suggests. Without it logind has nothing to ask, and its fallback for this action is to deny:
$ loginctl enable-linger
Could not enable linger: Access denied
Root skips polkit entirely, which is why CI never sees this: ci.yaml and release-smoke-linux.yaml both run sudo loginctl enable-linger before installing. Ubuntu installs polkitd by default (several of its default packages depend on it), so the Ubuntu VM used for #964 never hit it either. Debian with only the SSH server selected does.
What is wrong with the current message
- It doesn't name the cause.
loadServicediscards loginctl's output, so "Access denied" never reaches the user, and nothing mentions polkit. - It gives one fix for two different causes. A missing
polkitdis fixed by installing it, and the user can then turn lingering on themselves. A polkit that is present but refusing is local policy, which only root can override. The message says "ask an administrator" in both cases. - The command it gives doesn't work as written.
loginctl enable-linger $USERwithoutsudois the call that just failed. - Re-running setup doesn't recover. After installing polkit,
agentop setupfinds Cortex healthy, changes nothing, and reportscortex … is installed and healthy.while lingering stays off. Lingering is only attempted while loading the unit.agentop setup --restartdoes retry, but nothing says so. - Nothing documents it.
docs/laptop-service.mddoesn't mention lingering at all.
Found by
scripts/dev/verify-reboot-lingering.sh (#1409), whose Phase 1 fails at "install did not enable lingering" on such a host. It passes once polkitd is installed.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
Fix: Say why lingering failed when polkit is missing, and how to fix it