Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-141839

'uptime' / 'w' report an incorrect number of logged in users

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • rhel-10.2
    • rhel-10.1
    • procps-ng
    • None
    • procps-ng-4.0.4-11.el10
    • Yes
    • Low
    • rhel-plumbers
    • 23
    • 26
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • Fail
    • None
    • Release Note Not Required
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      In RHEL 10, both 'uptime' and 'w' commands do not report the correct number of users. For example, on a freshly booted RHEL 10 systems with no sessions opened, opening a session and running 'uptime' will show '2 users' logged in, when it's only one.

      It seems this occurs due to unconditionally reading /run/systemd/sessions and considering each entry there as a logged in user.

      Example reproducer:

      root@vm-rhel10:~# for i in $(seq 1 10); do touch /run/systemd/sessions/foo$i; done
      root@vm-rhel10:~# uptime
       16:37:22 up 20 min, 12 users,  load average: 0.03, 0.10, 0.08 

      This behaviour was not present in RHEL 9.

       

              jrybar@redhat.com Jan Rybar
              rhn-support-jsantos Juan Santos
              Jan Rybar Jan Rybar
              Karel Volný Karel Volný
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: