[systemd-devel] date/time set to epoch when using readonly rootfs

Lennart Poettering mzxreary at 0pointer.de
Thu Oct 22 09:51:03 UTC 2020


On Do, 22.10.20 11:47, Belisko Marek (marek.belisko at gmail.com) wrote:

> On Thu, Oct 22, 2020 at 10:52 AM Lennart Poettering
> <mzxreary at 0pointer.de> wrote:
> >
> > On Mi, 21.10.20 22:13, Belisko Marek (marek.belisko at gmail.com) wrote:
> >
> > > Hi,
> > >
> > > I'm facing a strange issue. When I boot system using systemd (244.3)
> > > and in one service I'm generating some certificates. When checking
> > > them I'm getting the result that the certificate was created 1.1.1970
> > > which is invalid. I can wait until I get a network connection and only
> > > then create certificates but I have only issues that some files are
> > > created and I'm getting date/time creation also epoch. Shouldn't it be
> > > the date/time of build? Can this be caused somehow by using read only
> > > rootfs? Thanks a lot for any pointers.
> >
> > This is strange. PID1 actually bumps the system clock to whatever
> > was chosen as "epoch" during build. By default that's the mtime of the
> > NEWS file in the source tree, i.e. usually the time of the used
> > systemd release.
> >
> > Thus, Jan 1970 should never be seen, unless your build explicitly
> > forces the epoch to be that. But why would you?
> Nope I'm not and it's not my intention.
> I checked systemd source code and I find out that systemd-update-done
> service add timestamp when /usr was created but in my case:
> * systemd-update-done.service - Update is Completed

Hmm? this service has nothing to do with epoch/clock setting. It's
used for systems that have a "reboot-for-update" mode.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list