mirror of
https://github.com/pygos/init.git
synced 2024-11-23 03:29:47 +01:00
c3249ae0c9
Some systems don't have a hardware real time clock and don't know the time after bootin. An obvious soulution for this is to use time from an ntp server. Unfortunately that requires domain name resolution, which resolvers like unbound won't do for us, if the DNSSEC certificates aren't valid, which they aren't if we start out with a time around 1970-1-1. The "software clock" service tries to provide a workaround by restoring a reasonably valid time from a backup file during boot, which we update when shuting down. If we wan't a more correct time, we have to update it from NTP in between. Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
7 lines
167 B
Text
7 lines
167 B
Text
description write current time to backup file
|
|
type wait
|
|
target %0
|
|
after sigkill
|
|
before sync
|
|
tty truncate @STATEFILESPATH@/swclock
|
|
exec date --utc +%%m%%d%%H%%M%%Y.%%S
|