who: SSH sessions are not listed when utmp is missing (systemd-logind backend)

Aperta
#16,749 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@anastygnome ci sta già lavorando.

Dal 21/11/2026.

  • #16752 di @anastygnome — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
linux, rust

Direzione di ricerca

Start from the session filter in src/uucore/src/lib/features/systemd_logind.rs around line 314, where sessions without a TTY, seat or display are dropped, then follow how src/uu/who/src/who.rs consumes those sessions and formats the columns GNU prints. Reproduce on a machine with no /run/utmp via loginctl and compare who against who -q; tests/by-util/test_who.rs shows the existing test harness. An open pull request (#16752) already targets this, so read it before writing anything.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

U - who

On Ubuntu 26.04 (rust-coreutils 0.10.0, no /run/utmp), who prints nothing while I'm logged in over SSH. GNU who on the same machine lists the sessions:

$ who
$ who -q

# users=0
$ gnuwho
bayandin sshd pts/1   2026-11-21 12:57 (192.168.0.156)
bayandin sshd pts/0   2026-11-21 12:17 (192.168.0.156)

logind doesn't record a TTY for these sessions:

$ loginctl show-session $XDG_SESSION_ID -p TTY -p Type -p Remote -p RemoteHost
TTY=
Type=tty
Remote=yes
RemoteHost=192.168.0.156

The logind backend skips sessions that have no TTY, seat or display, so SSH sessions are dropped:
https://github.com/uutils/coreutils/blob/6c6ed7369372dc87bb344d06921548e492a09ab9/src/uucore/src/lib/features/systemd_logind.rs#L314

Sessions with a TTY or seat, such as a local console login, are listed fine.

Lingua principale
Rust
Stelle
24.4k
Fork
2.2k
Merge medio
2g 23h
PR unite (30g)
402

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uutils/coreutils

Tutte le issue di uutils/coreutils

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.