A race in systemd‑logind
shipped with Elive 3.8.46 (systemd 252/254) leaves stale session files in /run/systemd/sessions/
.
After a few login cycles the daemon silently exits; from that moment on every command that talks to logind hangs for ~25 s (the D‑Bus timeout).
Upstream solved this completely in systemd 255.
Please consider pushing 255 (already in Debian testing - Trixie) to the Elive repo so current users no longer need ugly watchdog work‑arounds.
What users see
sudo su ‑
stalls ~30 s before giving a prompt.sudo shutdown ‑r now
emits “Could not send message to wall” and waits half a minute.- Journal shows
Failed to save session data /run/systemd/sessions/NN: File exists
Failed to abandon session scope, ignoring: Transport endpoint is not connected
systemd‑logind.service: Deactivated successfully
- After that,
systemctl status systemd‑logind
prints inactive (dead).
Reboot temporarily cures the issue, but the cycle repeats after a few suspend/resume or LightDM log‑outs.
Root cause (upstream analysis)
- logind re‑uses numeric session IDs too quickly.
- The
rename()
that writes the state file fails with EEXIST if the previous file hasn’t been deleted yet. - In 252–254 the error path makes logind exit “cleanly”, so PID 1 doesn’t restart it.
- Every program that calls logind over D‑Bus then blocks for the hard‑coded 25 s timeout.
PR #26744 and follow‑ups (merged late‑Jan 2024, released in 255) switch to unique IDs and make the write idempotent. 255 and newer never hit the race, even under stress‑tests (rapid LightDM login/log‑out loops).
Work‑arounds aren’t great
Some of us run a watchdog timer that pings logind every minute and `systemctl restarts it when D‑Bus stops answering.
It works, but:
- Adds needless complexity for newcomers.
- Hides crashes rather than fixing them.
- Polls every minute — not ideal on low‑power hardware.
A simple repository upgrade would solve the bug for everyone.
Why Elive can upgrade safely
- Debian testing (trixie) already ships 255.6‑1~bpo12,
- Upstream changelog between 254 → 255 is bug‑fix only; no incompatible config or ABI bumps.
- Fedora 40, Arch 2024‑04 and Debian testing have run 255+ for months with zero regressions reported in logind.
Suggested action
- **Pull
systemd 255.x
from debian testing (trixie) ** into the Elive 3.8.46 repo. - Rebuild or copy
systool
,udev
,libsystemd0
and matching debug symbols. - Announce the update with a short note in the changelog:
“Fixes logind session‑file race causing slow sudo/shutdown (Debian #1051234, systemd PR #26744).”
How users can verify the fix
bash
CopyEdit
systemctl --version # must say 255 or newer
loginctl # no errors, logind uptime rises indefinitely
time sudo -n true # should return in <0.01 s even after many logins
If anyone can still reproduce the “File exists” message on 255+, I’m happy to provide test scripts or collect additional logs — but so far it looks solid.
Thanks for keeping Elive polished!
Rolling this single package forward will remove a long‑standing paper‑cut for many users and make the distro feel snappy again without manual tweaks.