Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#866313: systemd: create /var/log/lastlog if it does not exist

150 views
Skip to first unread message

Peter Colberg

unread,
Jun 28, 2017, 4:00:04 PM6/28/17
to
Package: systemd
Version: 233-9
Severity: normal

Dear Maintainer,

Could you extend /usr/lib/tmpfiles.d/var.conf as follows?

f /var/log/lastlog 0664 root utmp -

systemd already creates /var/log/wtmp and /var/log/btmp if they do not
exist. For custom live-boot images that exclude files under /var/log/,
it would be nice to also create /var/log/lastlog, e.g., for sshd:

# grep lastlog /var/log/auth.log
Jun 27 20:00:00 huron sshd[1234]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory

Regards,
Peter

Michael Biebl

unread,
Jun 28, 2017, 4:20:03 PM6/28/17
to
Hi
I can see the reason why /var/log/{utmp,wtmp} are shipped by systemd.
See man systemd-update-utmp

I don't immediately see a good reason why such a tmpfile for lastlog
would belong into systemd though, given that systemd does not touch that
file at all.
Can you please elaborate?
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

signature.asc

Peter Colberg

unread,
Jun 28, 2017, 9:30:03 PM6/28/17
to
Hi Michael,

On Wed, Jun 28, 2017 at 10:10:25PM +0200, Michael Biebl wrote:
> Am 28.06.2017 um 21:50 schrieb Peter Colberg:
> > Package: systemd
> > Version: 233-9
> > Severity: normal
> >
> > Dear Maintainer,
> >
> > Could you extend /usr/lib/tmpfiles.d/var.conf as follows?
> >
> > f /var/log/lastlog 0664 root utmp -
> >
> > systemd already creates /var/log/wtmp and /var/log/btmp if they do not
> > exist. For custom live-boot images that exclude files under /var/log/,
> > it would be nice to also create /var/log/lastlog, e.g., for sshd:
> >
> > # grep lastlog /var/log/auth.log
> > Jun 27 20:00:00 huron sshd[1234]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
>
> I can see the reason why /var/log/{utmp,wtmp} are shipped by systemd.
> See man systemd-update-utmp
>
> I don't immediately see a good reason why such a tmpfile for lastlog
> would belong into systemd though, given that systemd does not touch that
> file at all.
> Can you please elaborate?

In Debian, base-files creates the files /var/log/wtmp /var/log/btmp
/var/log/lastlog in postinst [1]. For consistency, systemd should
recreate all of these three files if needed.

Regards,
Peter

[1] https://sources.debian.net/src/base-files/10/debian/postinst.in/#L86

Michael Biebl

unread,
Jun 29, 2017, 11:40:04 AM6/29/17
to
Hi Peter

I've filed https://github.com/systemd/systemd/pull/6235 in the mean
time. Upstream now rightfully wants to know, why the file has to be
0664 root:utmp. I don't know the reason for that.

Peter, could you ask the base-files maintainer why the file is created
with those permissions:
https://sources.debian.net/src/base-files/10/debian/postinst.in/#L95

If you have an answer, you can also directly follow-up upstream.

Regards,
Michael
signature.asc
0 new messages