Bug#964444: systemd-timesyncd: time synchronization suddenly stopped working

Vincent Lefevre vincent at vinc17.net
Sat Aug 29 22:52:08 BST 2020


On 2020-08-29 16:45:49 +0200, Michael Biebl wrote:
> I see that this has been addressed in
> https://github.com/systemd/systemd/pull/16624 which is part of v246, so
> closing the bug report accordingly.

Note that the upstream solution is a bit incomplete. It reduces
the maximum time before sync to 6 minutes. But that's still up
to 6 minutes to wait after sleep/resume.

I've solved this issue on my side with a script
/etc/network/if-up.d/timesyncd to restart systemd-timesyncd after
the network is up (which yields an immediate NTP connection):

------------------------------------------------------------------------
#!/bin/sh

[ "$IFACE" != "lo" ] || exit 0
[ -d /run/systemd/system ] || exit 0
[ -x /lib/systemd/systemd-timesyncd ] || exit 0

cmd="systemctl try-restart systemd-timesyncd.service"
[ -x /usr/bin/logger ] && /usr/bin/logger -t "${0#/etc/network/}" "$cmd"
$cmd || true
------------------------------------------------------------------------

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



More information about the Pkg-systemd-maintainers mailing list