From ece6e766cf89c8ec82ad135969dedf16cd7c1ee8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 21 May 2014 00:04:11 +0900 Subject: timesyncd: save clock to disk everytime we get an NTP fix, and bump clock at boot using this This is useful to make sure the system clock stays monotonic even on systems that lack an RTC. Also, why we are at it, also use the systemd release time for bumping the clock, since it's a slightly less bad than starting with jan 1st, 1970. This also moves timesyncd into the early bootphase, in order to make sure this initial bump is guaranteed to have finished by the time we start real daemons which might write to the file systemd and thus shouldn't leave 1970's timestamps all over the place... --- units/systemd-timesyncd.service.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'units/systemd-timesyncd.service.in') diff --git a/units/systemd-timesyncd.service.in b/units/systemd-timesyncd.service.in index 1d1f4860a8..ec2871455e 100644 --- a/units/systemd-timesyncd.service.in +++ b/units/systemd-timesyncd.service.in @@ -9,17 +9,21 @@ Description=Network Time Synchronization Documentation=man:systemd-timesyncd.service(8) ConditionCapability=CAP_SYS_TIME -After=systemd-networkd.service +DefaultDependencies=off +RequiresMountsFor=/var/lib/systemd/clock +After=systemd-remount-fs.service +Before=sysinit.target shutdown.target +Conflicts=shutdown.target [Service] Type=notify Restart=always RestartSec=0 ExecStart=@rootlibexecdir@/systemd-timesyncd -CapabilityBoundingSet=CAP_SYS_TIME CAP_SETUID CAP_SETGID CAP_SETPCAP +CapabilityBoundingSet=CAP_SYS_TIME CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_DAC_OVERRIDE PrivateTmp=yes PrivateDevices=yes WatchdogSec=1min [Install] -WantedBy=multi-user.target +WantedBy=sysinit.target -- cgit v1.2.3-54-g00ecf