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

Đang mở
#16,749 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@anastygnome đang làm issue này rồi.

Từ ngày 21/11/2026.

  • #16752 của @anastygnome — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
linux, rust
Lĩnh vực
cli, operating-systems

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
24.4k
Fork
2.2k
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
402

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của uutils/coreutils

Tất cả issue của uutils/coreutils

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.