On Mon, Feb 17, 2025 at 10:25 AM Vincent Lefevre <vinc...@vinc17.net> wrote: > > On 2025-02-17 08:03:23 +0100, Thorsten Kukuk wrote: > > Some terminal applications (e.g. xterm, konsole, ...) create fake utmp > > entries for historic reasons: so that broadcast messages are shown in > > every single terminal. Which for people, who only work with graphical > > applications, but not terminals, is not from help, as they will never > > see them. > > No, there may be other uses. For instance, "who -d" reports > information about dead terminal processes. Obviously, this is > not for broadcast messages (more for debugging purpose, IMHO). > However, for xterm at least, the output information is incorrect > (term & exit values are always 0).
"who -d" shows which login processes exit without removing the utmp entry and where the init process cleaned up the utmp entry instead. Since no terminal is controlled by an init process, you should never see any terminal listed. So I have my doubts that you ever saw there terminal processes. And if yes, something was terrible broken with your init and login process. And "who -d" will only show these entries if no other process was quicker and recycled that entry already. I think you can implement that with systemd, too, if a process quits without telling that systemd-logind. And that would be even more exact, as it wouldn't be overwritten by the next process. But nobody asked for that until now. > "who -u" also reports useful information, such as the idle time > and the PID of the terminal process. The absence of utmp completely > breaks this feature. Yes, and this feature never worked reliably if I look at all the old bug reports for openSUSE. This "feature" is very terminal centric and stopped already working when people decided to use graphical applications and not terminals. It's the old question: what does idle mean in this context? 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)