"who" command is not listing the users

Bug #2103489 reported by bugproxy
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Release Notes for Ubuntu
Fix Released
Undecided
Unassigned
The Ubuntu-power-systems project
Fix Released
Low
Ubuntu on IBM Power Systems Bug Triage
coreutils (Debian)
Fix Released
Unknown
coreutils (Ubuntu)
Status tracked in Questing
Plucky
Fix Released
Undecided
Unassigned
Questing
Fix Released
Undecided
Unassigned
systemd (Ubuntu)
Won't Fix
Undecided
Unassigned
Plucky
Won't Fix
Undecided
Unassigned
Questing
Won't Fix
Undecided
Unassigned

Bug Description

SRU Justification:
------------------

[ Impact ]

 * The small but well known and popular tool 'who',
   included in the coreutils package,
   is not built in the correct way in Ubuntu 25.04,
   hence does not work properly
   and just prints nothing when executed on 25.04.

 * In Ubuntu, systemd is no longer built with utmp support.
   Among other things, this means that systemd’s default
   /usr/lib/tmpfiles.d/systemd.conf no longer creates /run/utmp.

 * To solve this situation coreutils needs to be build
   with '--enable-systemd' in dh_auto_configure
   and also requires libsystemd-dev as Build-Depends.

[ Test Plan ]

 * Install a plain Ubuntu 25.04 on any supported architecture,
   since this bug was first opened on ppc64el,
   ideally test this on ppc64el as well.

 * Verify the default coreutils package version with
   $ apt-cache policy coreutils
   It should report: Installed: 9.5-1ubuntu1

 * Just type and execute 'who' to recreate the error situation:
   $ who
   $

 * Now install the modified package
   (from proposed, here in this example from my PPA)
   and verify that it is the currently installed package:
   $ apt-cache policy coreutils
   It should report the new version, like "Installed: 9.5-1ubuntu1.1"

 * Now 'who' should work fine again and prints an output similar to:
   $ who
   ubuntu sshd pts/0 2025-04-24 08:51 (10.xxx.xxx.xxx)

 * Since building with '--enable-systemd' has also an affect on
   the pinky, users, and uptime binaries (because all call read_utmp()
   as well), it's reasonable to test these on top:

   * executing 'pinky ubuntu' with package 9.5-1ubuntu1 leads to:
     $ pinky ubuntu
     Login Name TTY Idle When Where
     but with the modified package:
     $ pinky ubuntu
     Login Name TTY Idle When Where
     ubuntu ubuntu sshd pts/0 2025-04-25 16:24 10.xxx.xxx.xxx

   * executing 'users' with package 9.5-1ubuntu1 leads to:
     $ users
     $
     but with the modified package:
     $ users
     ubuntu

   * executing 'uptime' with package 9.5-1ubuntu1 leads to:
     $ uptime
      16:40:23 up 9 days, 4:11, 2 users, load average: 0.00, 0.00, 0.00
     and with the modified package:
     $ uptime
      16:40:52 up 9 days, 4:10, 2 users, load average: 0.00, 0.00, 0.00
     (so uptime was actually not affected)

[ Where problems could occur ]

 * Due to the previous entry in the Release Notes,
   one may think that this is not going to be fixed in 25.04
   and might already have accepted ot worked around this.

 * The new Build-Depends might have been forgotten,
   in this case the above test would not lead to a working
   package and 'who' command.

 * Adding '--enable-systemd' could lead to unforeseen changes in behavior,
   but this is very unlikely. Autopkgtests may help to verify.

 * Since the code itself stays unchanged and only package meta data
   gets modified, there are barely more problems that may occur.

[ Other Info ]

 * A test build was done in PPA (for all architectures we support)
   and is available here:
   https://launchpad.net/~fheimes/+archive/ubuntu/lp2103489

 * The test package was successfully verified
   (like described in the Test Plan above).

 * Since the development of the Q release ('Questing') was just opened,
   this might need to be uploaded to 'Questing' first before
   we can SRU to Plucky/25.04.
__________

== Comment: #0 - Kowshik Jois B S <email address hidden> - 2025-03-17 09:06:44 ==
---Problem Description---
"who" command is not listing the users.

---Steps to Reproduce---
1. Install Ubuntu25.04 on a PowerVM LPAR
2. Execute "who" command

---uname output---
Linux ubhost2504 6.14.0-10-generic #10-Ubuntu SMP Wed Mar 12 16:05:46 UTC 2025 ppc64le ppc64le ppc64le GNU/Linux

root@ubhost2504:~# ls /run/utmp
ls: cannot access '/run/utmp': No such file or directory

Additional details:

root@ubhost2504:~# systemctl restart systemd-logind.service
root@ubhost2504:~# sleep 5
root@ubhost2504:~# ls /run/utmp
ls: cannot access '/run/utmp': No such file or directory
root@ubhost2504:~#

root@ubhost2504:~# apt list --installed | grep -E "coreutils|procps|util-linux|sysvinit"
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

coreutils/plucky,now 9.5-1ubuntu1 ppc64el [installed,automatic]
procps/plucky,now 2:4.0.4-4ubuntu5 ppc64el [installed,automatic]
sysvinit-utils/plucky,now 3.14-1ubuntu1 ppc64el [installed,automatic]
util-linux/plucky,now 2.40.2-14ubuntu1 ppc64el [installed]
root@ubhost2504:~

root@ubhost2504:~# apt list --installed | grep -E "util-linux|systemd|login"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libnss-systemd/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
libpam-systemd/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
libsystemd-shared/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
libsystemd0/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
login.defs/plucky,now 1:4.16.0-7ubuntu1 all [installed,automatic]
login/plucky,now 1:4.16.0-2+really2.40.2-14ubuntu1 ppc64el [installed,automatic]
python3-systemd/now 235-1build5 ppc64el [installed,upgradable to: 235-1build6]
systemd-cryptsetup/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
systemd-hwe-hwdb/plucky,now 256.4.1 all [installed,automatic]
systemd-resolved/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
systemd-sysv/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
systemd-timesyncd/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
systemd/now 257.2-3ubuntu1 ppc64el [installed,upgradable to: 257.3-1ubuntu3]
util-linux/plucky,now 2.40.2-14ubuntu1 ppc64el [installed]
root@ubhost2504:~#

root@ubhost2504:~# whoami
root
root@ubhost2504:~# tty
/dev/hvc0
root@ubhost2504:~#

Contact Information = <email address hidden>

Machine Type = P10 Rainier

---Debugger---
A debugger is not configured

Userspace tool common name: systemd

The userspace tool has the following bit modes: 64-bit

The file /run/utmp is missing.

Create the file by running:

# touch /run/utmp
Adjust the ownership and permissions:

# chown root:utmp /run/utmp; chmod g+w /run/utmp
Log out from the system and log back in.

root@ubhost2504:~# who
root pts/0 2025-03-18 06:03 (10.231.203.30)

Correct. That file is missing and it should get auto generated upon reboot. But in this case it is not happening.

Manual creation of the file will solve the issue temporarily but once the machine gets rebooted, the existing file will gets deleted(this is expected) and after reboot the file will be missing again(this is a bug. regeneration of that file should happen automatically after reboot but is not happening)

We are not seeing /var/run/utmp .. installed systemd/plucky,now 257.3-1ubuntu3 ppc64el [installed,automatic]

but these file is missing.

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-212187 severity-low targetmilestone-inin---
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → systemd (Ubuntu)
Revision history for this message
Nick Rosbrook (enr0n) wrote :

We no longer build systemd with utmp support, which among other things, means that /run/utmp is not created by systemd's default tmpfiles.

`who` from coreutils does not yet have support for systemd-logind sessions I guess. However, `w` from procps does support this.

Changed in systemd (Ubuntu):
status: New → Triaged
status: Triaged → New
tags: added: rls-pp-incoming
Revision history for this message
Frank Heimes (fheimes) wrote :

(Even if I strongly believe that this is not limited to ppc64el alone,
 I'm marking this as affected the IBM Power LP project, since it came in via this channel.)

Changed in systemd (Ubuntu):
assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → nobody
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2025-03-18 10:16 EDT-------
Thanks for the response enr0n.

I would like to know from which version of ubuntu that the support for building systemd with utmp is stopped?

Is this info available in any of the release notes? If yes, could you please point me to that.

Revision history for this message
Nick Rosbrook (enr0n) wrote :

Plucky (25.04) is the first time this will be the case. It will be in the release notes, but we're still in development so that's not finalized.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in coreutils (Ubuntu):
status: New → Confirmed
Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Nick Rosbrook (enr0n) wrote :
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2025-03-19 02:03 EDT-------
Thank you enr0n for providing the info and the release notes. per above comments I am closing this bug.

Revision history for this message
Julian Andres Klode (juliank) wrote :

I am going to mark the tasks as won't fix as this is listed in the release notes

Changed in systemd (Ubuntu):
status: Confirmed → Won't Fix
Changed in coreutils (Ubuntu):
status: Confirmed → Won't Fix
status: Won't Fix → Triaged
tags: removed: rls-pp-incoming
Revision history for this message
Julian Andres Klode (juliank) wrote :

Actually tagging the coreutils one as triaged as it should refer you to logind or support reading from there

Revision history for this message
Benjamin Drung (bdrung) wrote :

It looks like we just have to build coreutils with --enable-systemd.

Changed in coreutils (Debian):
status: Unknown → Confirmed
Revision history for this message
Frank Heimes (fheimes) wrote (last edit ):

This issue was added to the Ubuntu 25.04 release notes:
https://discourse.ubuntu.com/t/plucky-puffin-release-notes/48687#p-120902-systemd-v2574

(this is btw. not limited to ppc64el, but across architectures)

Changed in ubuntu-release-notes:
status: New → Fix Released
Changed in ubuntu-power-systems:
status: New → Confirmed
Revision history for this message
Bruno Haible (bruno-clisp) wrote :

Re #12:
> This issue was added to the Ubuntu 25.04 release notes:
> https://discourse.ubuntu.com/t/plucky-puffin-release-notes/48687#p-120902-systemd-v2574

This releases notes says:
  "While some tools, such as w from the procps package have support for systemd-logind sessions, other tools like who from coreutils do not."

This is a blatant lie. 'who' from coreutils 9.5 *does* support for the systemd-logind sessions. You only have two build it appropriately.

More in detail:
  1) You need to pass the configure option '--enable-systemd' (as stated in #11 above).
  2) You need to have installed libsystemd-dev at build time. The problem is in this file:
https://archive.ubuntu.com/ubuntu/pool/main/c/coreutils/coreutils_9.5-1ubuntu1.dsc
It has a Build-Depends line that is *missing* libsystemd-dev.

Revision history for this message
Frank Heimes (fheimes) wrote :

Hello Bruno,
I am not sure where the release notes entry came from, but I just noticed it and referenced it above in comment #12: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2103489/comments/12

The status of Fix Released on the affected release notes entry just means that it was mentioned in the release notes, it does not say that the overall bug got closed.

In particular the affected packages coreutils (Debian) and coreutils (Ubuntu) are still open (as Confirmed and Triaged).

But I agree with you that it needs to be build in a slightly different way, like Benjamin already pointed out in comment #11: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2103489/comments/11

Revision history for this message
Frank Heimes (fheimes) wrote :

Since I'm just working on the architecture (ppc64el) where this was reported first, I had a first look at this bug and triaged it initially.
Let me check how this can be sorted ...

Revision history for this message
Frank Heimes (fheimes) wrote :
Frank Heimes (fheimes)
description: updated
Revision history for this message
Frank Heimes (fheimes) wrote :

Since the development of the Q-release ("Questing Quokka") just started, and we have now the coreutils package in P and Q in the same version, the versioning for both releases need to be slightly adjusted to ensure proper upgradeability.
Hence uploading this tgz file that incl. two debdiffs (for Q and P).

Changed in coreutils (Ubuntu):
status: Triaged → Confirmed
Frank Heimes (fheimes)
Changed in systemd (Ubuntu Plucky):
status: New → Won't Fix
Changed in coreutils (Ubuntu Plucky):
status: New → Confirmed
status: Confirmed → In Progress
Changed in coreutils (Ubuntu Questing):
status: Confirmed → In Progress
Changed in ubuntu-power-systems:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
importance: Undecided → Low
Revision history for this message
Nick Rosbrook (enr0n) wrote :

Thanks, Frank!

Debian has already fixed this, so we will get this in questing via the next merge of coreutils, but I think it's fine to upload now anyways. So I will sponsor for questing.

The plucky debdiff LGTM, too. Just a couple requests for the SRU test plan. Looking at the coreutils source, it looks like the who, pinky, users, and uptime binaries all call read_utmp(). In addition to the test you have for `who`, can you please add quick checks for the other binaries to make sure this SRU does not change behavior unexpectedly?

In any case, I will sponsor both of these now.

Revision history for this message
Frank Heimes (fheimes) wrote :

Hi Nick, thanks for having the upload(s) sponsored.

I definitely makes sense to add a quick tests for all tools that call read_utmp().
I expanded the test plan accordingly.

description: updated
Changed in coreutils (Debian):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package coreutils - 9.5-1ubuntu1.25.10.1

---------------
coreutils (9.5-1ubuntu1.25.10.1) questing; urgency=medium

  * Modify d/rules to dh_auto_configure with --enable-systemd,
    and add libsystemd-dev as Build-Depends in d/control
    to solve LP: #2103489.

 -- Frank Heimes <email address hidden> Fri, 25 Apr 2025 08:55:05 +0200

Changed in coreutils (Ubuntu Questing):
status: In Progress → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello bugproxy, or anyone else affected,

Accepted coreutils into plucky-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/coreutils/9.5-1ubuntu1.25.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-plucky to verification-done-plucky. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-plucky. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in coreutils (Ubuntu Plucky):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-plucky
Revision history for this message
Frank Heimes (fheimes) wrote :

Successfully verified on plucky.
Updated tags accordingly.

tags: added: verification-done verification-done-plucky
removed: verification-needed verification-needed-plucky
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (coreutils/9.5-1ubuntu1.25.04.1)

All autopkgtests for the newly accepted coreutils (9.5-1ubuntu1.25.04.1) for plucky have finished running.
The following regressions have been reported in tests triggered by the package:

dotnet8/8.0.115-8.0.15-0ubuntu1 (amd64)
dotnet8/unknown (s390x)
dotnet9/unknown (ppc64el)
linux-realtime/6.14.0-1003.3 (amd64)
parafly/unknown (s390x)
rsyslog/unknown (s390x)
samba/2:4.21.4+dfsg-1ubuntu3 (s390x)
wheel/0.45.1-1 (s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/plucky/update_excuses.html#coreutils

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

This maybe relevant, maybe won't: I run a multipass container with questing, and the `who` command provided by rust-coreutils doesn't work. The command provided by gnu-coreutils does work.

Revision history for this message
Frank Heimes (fheimes) wrote :

I finally got all autopkgtest issues resolved (was mostly infrastructure/timeouts)
and the page
https://people.canonical.com/~ubuntu-archive/proposed-migration/plucky/update_excuses.html#coreutils
is happy (all green).
So this should be unblocked the proposed-migration.

@bugproxy This is about GNU coreutils (rust-coreutils implementation is probably different here and there and one may need to switch back).

Changed in ubuntu-power-systems:
status: Confirmed → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Update Released

The verification of the Stable Release Update for coreutils has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package coreutils - 9.5-1ubuntu1.25.04.1

---------------
coreutils (9.5-1ubuntu1.25.04.1) plucky; urgency=medium

  * Modify d/rules to dh_auto_configure with --enable-systemd,
    and add libsystemd-dev as Build-Depends in d/control
    to solve LP: #2103489.

 -- Frank Heimes <email address hidden> Thu, 24 Apr 2025 10:58:04 +0200

Changed in coreutils (Ubuntu Plucky):
status: Fix Committed → Fix Released
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.