Checking systemd unit statuses using systemctl --failed on an Ubuntu server or desktop system can reveal a degraded service: systemd-timesyncd.service: Failed with result 'exit-code' or Failed to start Network Time Synchronization. When system clocks drift without NTP synchronisation, TLS certificates fail validation, database transactions desynchronise, and cron schedules execute out of order.
Why Does systemd-timesyncd Fail to Start in Ubuntu?
The systemd-timesyncd daemon is Ubuntu default lightweight Network Time Protocol (NTP) client. Key causes of failure include:
- Port 123 Binding Conflicts: Another NTP daemon (such as
chrony,ntpd, oropenntpd) already running and binding exclusively to UDP port 123. - Unreachable Default NTP Pools: Firewalls or local network routers blocking outbound UDP traffic to default Ubuntu NTP servers (
ntp.ubuntu.com). - Corrupted Clock State File: An ungraceful system crash corrupting
/var/lib/systemd/timesync/clock, preventing timesyncd from establishing baseline timestamps. - Virtualisation Clock Synchronization Conflicts: Running Ubuntu inside containerised environments (such as LXC/OpenVZ) where the host hypervisor manages the hardware clock directly.
1. Inspect Journal Failure Logs for Specific Causes
Review the exact failure diagnostic recorded by systemd.
sudo systemctl status systemd-timesyncd.service
To inspect extensive startup log messages:
sudo journalctl -u systemd-timesyncd.service -b --no-pager
Common clues include Failed to bind to socket: Address already in use or Failed to call connect: Connection refused.
2. Resolve UDP Port 123 Collisions (Chrony vs Timesyncd)
If another time daemon is installed, choose one service to prevent port contention.
- Check which daemon is listening on NTP port 123:
sudo ss -tulpn | grep ':123 ' - If
chronyorntpdis running, you can safely disable and masksystemd-timesyncd:sudo systemctl stop systemd-timesyncd.service sudo systemctl disable systemd-timesyncd.service sudo systemctl mask systemd-timesyncd.service - If you prefer using
systemd-timesyncd, uninstall chrony and ntpd:sudo apt purge chrony ntp sudo systemctl unmask systemd-timesyncd.service sudo systemctl restart systemd-timesyncd.service
3. Purge Corrupted Clock State File
Deleting damaged timestamps allows timesyncd to establish a clean state vector.
sudo rm -f /var/lib/systemd/timesync/clock
The service will automatically recreate this tracking file during its next successful server poll.
4. Configure Custom NTP Servers in timesyncd.conf
If your ISP or enterprise firewall blocks ntp.ubuntu.com, configure public fallback NTP pools.
- Open the configuration file:
sudo nano /etc/systemd/timesyncd.conf - Uncomment the
NTP=line and specify reliable global pools (e.g. Cloudflare and Google):[Time] NTP=time.cloudflare.com time.google.com FallbackNTP=0.pool.ntp.org 1.pool.ntp.org - Save and exit (Ctrl + O, Enter, Ctrl + X).
- Restart and verify time synchronization:
sudo systemctl restart systemd-timesyncd.service timedatectl timesync-status