Skip to content

w: Fix handling with elogind

Andrew Bower requested to merge abower/procps:fix-w-without-sd into trixie

Fix potential crash when systemd not in use and lack of results when elogind in use.

Addresses discussion points in https://bugs.debian.org/1108549 by taking advantage of the unambiguous information from systemd while coping with the fact that you can't distinguish between no sessions under elogind or not running elogind by falling back to utmp reading if systemd not running.

Scenarios tested

scenario systemd elogind none1
sessions ✓ (utmp)
no sessions 2 2 2
error N/A

Empty cells untested. The case of error from sd_get_sessions() seems low risk to me for testing purposes.

  1. No session management simulated by renaming /run/systemd under elogind

  2. 'No sessions' scenario exercised by scheduling at job 2 3

Edited by Andrew Bower

Merge request reports

Loading