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

Belisko Marek marek.belisko at gmail.com
Thu Oct 22 09:53:41 UTC 2020


On Thu, Oct 22, 2020 at 11:51 AM Lennart Poettering
<mzxreary at 0pointer.de> wrote:
>
> 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.
Sorry I mixed up things. Can you pls guide where can I find code which
set date/time from timestamp? Thanks
>
> Lennart
>
> --
> Lennart Poettering, Berlin

marek


More information about the systemd-devel mailing list