Subject: bug#900: procps: w does not query elogind for sessions

From: Andrew Bower <[email-masked]>
Date: Fri, 8 Aug 2025 22:56:34 +0100

Hi Mark,

On Thu, Jul 31, 2025 at 11:38:20PM +0100, Andrew Bower wrote:
> On Thu, Jul 31, 2025 at 05:27:57PM +0100, Mark Hindley wrote:
> > On Tue, Jul 29, 2025 at 09:26:52PM +0100, Andrew Bower wrote:
> > > > I think not: I run it from the console, so it relies on login(1).
> > > 
> > > I take it from this that you currently don't get any login entries,
> > > then?
> > 
> > I haven't upgraded to excalibur yet.
> > 
> > I have just updated procps in ceres to 2%4.0.4-9devuan1 which includes your fix
> > for Debian#1108549.
> 
> Thanks for merging that!
> 
> > Once that is in the mirrors, perhaps you can see what does and doesn't work?
> 
> Unfortunately it doesn't make any difference on Devuan because the fixes
> are in bits that are compiled out without libsystemd!
> 
> I think the locus of the work for Devuan (if we want to avoid libsystemd
> in core tools, which is reasonable but has consequences) is that we need
> to restore utmp-writing in other packages. That won't be fun or
> comprehensive.

Here is a patch that restores utmp writing to uses of login(1), which
fixes the reporting of virtual console sessions in 'w' on Devuan.

https://git.devuan.org/abower/util-linux/pulls/1

ajb85@arden:~/git/util-linux$ w
 22:50:08 up  1:09,  2 users,  load average: 0.36, 0.85, 1.19
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU  WHAT
ajb85    tty2     -                22:45    4:46   0.06s  0.06s -bash
ajb85@arden:~/git/util-linux$ finger
Login     Name           Tty      Idle  Login Time   Office     Office Phone
ajb85     Andrew Bower  *:0.0           Aug  8 21:40 (:0.0)
ajb85     Andrew Bower  *tty2        4  Aug  8 22:45

Andrew