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

Tomasz Torcz tomek at pipebreaker.pl
Thu Oct 22 05:58:04 UTC 2020


On Wed, Oct 21, 2020 at 10:13:10PM +0200, Belisko Marek 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.

  Waiting for network is probably a wrong think to do. You want
After=time-sync.target (see man systemd.special). Of course you need
something to provide this target.  Do you have
systemd-timesyncd.service* enabled?

* it's systemd's implementation of SNTP. Also tries to set system time to at
least time of last shutdown.


-- 
Tomasz Torcz               “Never underestimate the bandwidth of a station
tomek at pipebreaker.pl        wagon filled with backup tapes.”  — Jim Gray



More information about the systemd-devel mailing list