<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jaideep Grover</title>
    <description>The latest articles on DEV Community by Jaideep Grover (@jaideepg).</description>
    <link>https://dev.to/jaideepg</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3899477%2Fdd428ff4-38e1-43ee-9723-532693855076.png</url>
      <title>DEV Community: Jaideep Grover</title>
      <link>https://dev.to/jaideepg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jaideepg"/>
    <language>en</language>
    <item>
      <title>UTMP being phased out: - Why "who" returns empty output on modern ubuntu</title>
      <dc:creator>Jaideep Grover</dc:creator>
      <pubDate>Mon, 27 Apr 2026 19:53:58 +0000</pubDate>
      <link>https://dev.to/jaideepg/utmp-being-phased-out-why-who-returns-empty-output-on-modern-ubuntu-1chj</link>
      <guid>https://dev.to/jaideepg/utmp-being-phased-out-why-who-returns-empty-output-on-modern-ubuntu-1chj</guid>
      <description>&lt;p&gt;So, while operating on an Ubuntu 25.10 I had to use who to check the session, and something weird happened it basically didn't work, for a simple command not to work, I knew something was up with my machine so I did some digging, turns out the next alternative "w" was working just fine but not &lt;code&gt;who&lt;/code&gt;. My curiosity rose I checked out Launchpad Bug #2130814, other people encountered it as well and everyone had a different theory why the "who" not work but "w" did. So what happens is if you run "who" it would just return Exit Code: 0 and will not show you any information. &lt;/p&gt;

&lt;h2&gt;
  
  
  The bug
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;who&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$?&lt;/span&gt;
0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While tracking down the reason for this behavior, I got a lot of information that I was not really aware of, the real reason is Ubuntu is moving away from a mechanism that has been working for them since 1970s. While suspected its not a uutils-vs-gnu issue either, cause kind of the same thing happens with &lt;code&gt;gnuwho&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;gnuwho
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$?&lt;/span&gt;
0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both broken&lt;/p&gt;

&lt;p&gt;So, while looking at the bug &lt;a href="https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2130814" rel="noopener noreferrer"&gt;https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2130814&lt;/a&gt; which is open for a while, the original reporter noticed /var/run/utmp is missing, another possible reason seen by a reporter was an EACCESS (Permission Denied) on the /run/systemd/sessions/3 so probably AppArmor was denying it.&lt;/p&gt;

&lt;p&gt;I started by checking whether session tracking itself was broken. It wasn't.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;loginctl list-sessions
SESSION  UID USER   SEAT LEADER CLASS   TTY IDLE SINCE
      4 1000 ubuntu -    1010   user    -   no   -
      5 1000 ubuntu -    1313   manager -   no   -

2 sessions listed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Session do exist. Systemd knows it, for some reason who wasn't reading it. Next I checked the AppArmor theory, the other commentator saw "EACCESS" but on a clean Ubuntu 25.10 the session files had the required readable permission&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; /run/systemd/sessions/
&lt;span class="nt"&gt;-rw-r--r--&lt;/span&gt;  1 root root 330 Apr 26 18:27 4
&lt;span class="nt"&gt;-rw-r--r--&lt;/span&gt;  1 root root 309 Apr 26 18:27 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So files were present their and world-readable, "who" just doesn't look at it. The output of &lt;code&gt;loginctl --version&lt;/code&gt; made things click:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;loginctl &lt;span class="nt"&gt;--version&lt;/span&gt;
systemd 257 &lt;span class="o"&gt;(&lt;/span&gt;257.9-0ubuntu2.4&lt;span class="o"&gt;)&lt;/span&gt;
+PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT
&lt;span class="nt"&gt;-GNUTLS&lt;/span&gt; +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 &lt;span class="nt"&gt;-IDN&lt;/span&gt; +IPTC
+KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY
+P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF
&lt;span class="nt"&gt;-XKBCOMMON&lt;/span&gt; &lt;span class="nt"&gt;-UTMP&lt;/span&gt; +SYSVINIT +LIBARCHIVE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look near the end: &lt;code&gt;-UTMP&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Each of the flag shows whether systemd was built with that feature. A '+' means included a '-' means excluded. Most of them are included except UTMP. &lt;/p&gt;

&lt;p&gt;UTMP is Unix mechanism for tracking the logged in users. The files that are used by UTMP are &lt;code&gt;/var/run/utmp&lt;/code&gt; and &lt;code&gt;/var/run/utmpx&lt;/code&gt; and tools like 'who', 'last' and 'w' uses this. The modern Ubuntu 25.10 is made without this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; /var/run/utmp /var/run/utmpx
&lt;span class="nb"&gt;ls&lt;/span&gt;: cannot access &lt;span class="s1"&gt;'/var/run/utmp'&lt;/span&gt;: No such file or directory
&lt;span class="nb"&gt;ls&lt;/span&gt;: cannot access &lt;span class="s1"&gt;'/var/run/utmpx'&lt;/span&gt;: No such file or directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  But why
&lt;/h2&gt;

&lt;p&gt;In October 2024, Debian systemd maitainer announced that the support for UMTP will be discontinued. The reason was y2038 problem, to elaborate, UTMP works on a 32 bit system, due to limited bits it would overflow on January 19 2038, so rather than redesigning the whole system the world is pivoting to wtmpdb as the successor. wtmpdb is a SQLite-backed login database to be y2038 safe. And if that doesn't work for you, you can use &lt;code&gt;w&lt;/code&gt;. But this means while updating to new operating system or environment people might need to tweak some commands as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does w work though
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;w
 18:31:03 up 17 min,  1 user,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU  WHAT
ubuntu   pts/0    18.206.107.29    18:27    6.00s  0.07s   ?    w
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;w&lt;/code&gt; is part of the &lt;code&gt;procps&lt;/code&gt; package which has been updated, it only used utmp as one of the source for findings &lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons and Closing
&lt;/h2&gt;

&lt;p&gt;I posted a comment for the bug &lt;a href="https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2130814" rel="noopener noreferrer"&gt;https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2130814&lt;/a&gt;&lt;br&gt;
I believe there will be plenty of people who would hit this problem, hopefully this helps them. &lt;/p&gt;

&lt;p&gt;The main problem here was not an error message, it was the empty response any workflow would get disturbed and updated with an error but the empty output could make problems way worse. So if you encounter problem the alternatives are &lt;code&gt;w&lt;/code&gt; or &lt;code&gt;loginctl list-sessions&lt;/code&gt; &lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>linux</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
