Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A few years ago I wrote[0] about a similar approach on an RTC-less system (a Raspberry 3B+) by utilising systemd's clock-epoch to set time across reboots to be "reasonably close enough" for DNS-over-TLS and chrony's NTS to take over, and avoid large time jumps being observed by daemons.

To that last point: reading this file is one of the very first things systemd does after being started right in main, so time is set before any services are brought up. Whereas time for the OP isn't set until the `500datetime` service is loaded.

[0]: https://terinstock.com/post/2021/12/Systemds-clock-epoch-for...



Nice systemd solution, it seems very elegant!

To be clear, my init script is named S00datetime, not 500datetime. It's actually the very first one that runs from rcS. So the date is restored very, very early in the boot process before pretty much everything else.


Now that you mention it I can't see anything other than an "S". Yes, that certainly makes it less of a problem.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: