Subject: Re: readutmp should check for sd_booted() and not if /run/utmp exists

From: Thorsten Kukuk <[email-masked]>
Date: Fri, 15 Sep 2023 13:02:15 +0000

Sorry, looks like strace confused me (since this checks the existence of
/run/utmp) and the problem is a different one.

kukuk@rubicon:~> ls /run/utmp
ls: cannot access '/run/utmp': No such file or directory
kukuk@rubicon:~> w
 14:54:41 up 4 days,  4:51,  2 users,  load average: 0,11, 0,13, 0,46
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
kukuk             172.17.0.109     14:54   22:57m  2:19m  0.04s sshd: kukuk [priv]
kukuk    tty2     -                 Mo10    4days 46:26   0.07s /usr/libexec/sddm/sddm-helper --socket /tmp/sddm-auth-4209f4f2-82f8-4a75-862d-c31963792a08 --id 1 --start /usr/bin/startplasma-x11 --user kukuk
kukuk@rubicon:~> who
kukuk    sshd pts/13  2023-09-15 14:54 (172.17.0.109)
kukuk    seat0        2023-09-11 10:03 (:0)
kukuk    tty2         2023-09-11 10:03 (:0)

Who creates an additional line for "seat0", which no other tools creates
and which it did not create before. Since some display manager writes
wrongly multiple utmp entries, one with the real tty, one with "seat0" as 
device, and with seeing /run/utmp in the strace output, I wrongly assumed
we prefer /run/utmp over logind.

So, there are two problems:
1. I don't think who should show an additional "seat0" line other tools
and who in the past did not show. That's confusing.
2. There are reports that who/uptime seg.faults if gdm is used as display
manager. The reporter confirmed, that this does not happen with sddm,
login, sshd or so.

Since I don't use GNOME, I cannot reproduce. The seg.faults are new
reports.

  Thorsten

-- 
Thorsten Kukuk, Distinguished Engineer, Senior Architect, Future Technologies
SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nuernberg, Germany
Managing Director: Ivo Totev, Andrew McDonald, Werner Knoblich
(HRB 36809, AG Nürnberg)