On 2024-10-23 14:07:52 +0200, Chris Hofstaedtler wrote:
> On Wed, Oct 23, 2024 at 11:59:24AM +0200, Celelibi wrote:
> > Screen relies on libutempter to update the utmp database. I don't know
> > if Screen should be updated to use libwtmpdb instead of libutempter or
> > if libutempter should be updated to wrap libwtmpdb.

First, IMHO, the use of libutempter by GNU Screen has always been
broken: the GNU Screen ttys are listed in utmp only when the Screen
session is being attached. This means that if a "wall" message is
sent while GNU Screen is detached, the user will not be able to see
it (even if GNU Screen is attached as few seconds later). Moreover,
this gives lots of useless information in wtmp, like

vinc17   pts/2        Tue Jan  6 17:27 - 17:27  (00:00)     :pts/8:S.1
vinc17   pts/3        Tue Jan  6 17:27 - 17:27  (00:00)     :pts/8:S.2
vinc17   pts/1        Tue Jan  6 17:27 - 17:27  (00:00)     :pts/8:S.0
vinc17   pts/2        Tue Jan  6 17:05 - 17:05  (00:00)     :pts/8:S.1
vinc17   pts/3        Tue Jan  6 17:05 - 17:05  (00:00)     :pts/8:S.2
vinc17   pts/1        Tue Jan  6 17:05 - 17:05  (00:00)     :pts/8:S.0
vinc17   pts/2        Tue Jan  6 17:04 - 17:04  (00:00)     :pts/8:S.1
vinc17   pts/3        Tue Jan  6 17:04 - 17:04  (00:00)     :pts/8:S.2
vinc17   pts/1        Tue Jan  6 17:04 - 17:04  (00:00)     :pts/8:S.0
vinc17   pts/3        Tue Jan  6 17:03 - 17:03  (00:00)     :pts/8:S.2
vinc17   pts/2        Tue Jan  6 17:03 - 17:03  (00:00)     :pts/8:S.1
vinc17   pts/1        Tue Jan  6 17:03 - 17:03  (00:00)     :pts/8:S.0
vinc17   pts/2        Tue Jan  6 17:00 - 17:02  (00:02)     :pts/8:S.1
vinc17   pts/3        Tue Jan  6 17:00 - 17:02  (00:02)     :pts/8:S.2
vinc17   pts/1        Tue Jan  6 17:00 - 17:02  (00:02)     :pts/8:S.0

(on a bookworm machine).

> Probably neither. utmp is for "currently logged in" things; this
> info is held in memory in logind. wtmpdb is not for this type of
> info, and where necessary its plugged into PAM.

Well, this may be useful for the GNU Screen session itself (in addition
to things needed with logind). The reason is that Screen sessions are
asynchronous with logins and logouts: a Screen session may still be
running after a ssh session that started it has been closed.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Reply via email to