[systemd-devel] lastlog and friends

Lennart Poettering lennart at poettering.net
Tue Jul 29 12:28:42 PDT 2014


On Tue, 29.07.14 14:43, Karel Zak (kzak at redhat.com) wrote:

> 
> 
>  systemd TODO:
> 
>     - Replace utmp, wtmp, btmp, and lastlog completely with journal
> 
> 
>  Can someone elaborate and provide more details, ideas, .. ?

Basically, we just want to have a nice tool that can dump data similar
to "lastlog" or "last" to stdout, originating from the journal.

utmp (i.e. data about who is currently logged in) is actually mostly
covered by "loginctl" already.

Not sure where precisely that tool should actually live though. I am
tempted to say it should just be a one or two additional verbs for
loginctl (which should gain some journal integration anyway, for example
to show log messages of a specific session and suchlike). 

While this funcionality should make equivalent data as "lastlog" or
"last" available, this is explicitly not about providing interface
compatibility.

>  The current lastlog is sparse file and it's difficult to use for backup 
>  programs or integrity checkers, etc. So requests from users/customers
>  are pretty common.
>  
>  The idea (from someone from RH) is to have very simple and tiny
>  library that provides unified API for different backends (classic
>  lastlog, systemd journal, etc.) to keep applications portable.
>  Something like:
> 
>    https://github.com/marmolak/liblastlog2
> 
>  Frankly, I'd like to see something more than only lastlog, but also
>  utmp, wtmp support.

Honestly, this sounds like something awfully peripheral to deserve a
library of its own. 

Also, a library whose primary purpose is to be abstraction glue to
support one backend that is supposed to be the backend of the future and
one that is really something that should go away sounds like a bad
idea. I mean, what would the benefit be?  Eventually people should just
use the modern API anyway. And until that day they can use the old utmp
API. And asking them to port everything to a third API in between sounds
like an excercise in creating more work for poor overworked
developers... ;-)

Note that accounts-service actually provides an API to query some
details of utmp (for example used to populated the faces browser in
gdm). Now, accounts-services was always intended to be a stopgap, but I
am pretty sure querying lastlog/utmp info is best done in it, or in the
subsystem that one day might replace it. I think lastlog/utmp/wtmp
handling is just one detail of user management the way accounts-service
is doing it.

I hope that makes some sense.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list