Sorry, I noticed current distro's with systemd
use below one for time sync instead of old fashion ntpd
:
$ man systemd-timesyncd.service
[..]
DESCRIPTION
systemd-timesyncd is a system service that may be used to
synchronize the local system clock with a remote Network Time
Protocol server. It also saves the local time to disk every time
the clock has been synchronized and uses this to possibly
advance the system realtime clock on subsequent reboots to
ensure it monotonically advances even if the system lacks a
battery-buffered RTC chip.
If want to know if systemd-timesyncd
is active:
$ sudo service systemd-timesyncd status
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: active (running) since Mon 2019-06-03 07:50:04 CEST; 3 weeks 0
If want to check if its configured to sync:
$ timedatectl
[..]
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
NTP servers need to be configured here on the "NTP=
" line:
$ cat /etc/systemd/timesyncd.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See timesyncd.conf(5) for details.
[Time]
#NTP=
#FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
Eg.
NTP=109.236.82.30 95.211.212.5 80.100.130.235 149.210.142.45
EDIT: Ow and for the record, if you still have ntpd
installed (apt policy ntp
), below one is holding systemd-timesyncd
back:
pi@noads:~ $ cat /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf
[Unit]
# don't run timesyncd if we have another NTP daemon installed
ConditionFileIsExecutable=!/usr/sbin/ntpd
ConditionFileIsExecutable=!/usr/sbin/openntpd
ConditionFileIsExecutable=!/usr/sbin/chronyd
ConditionFileIsExecutable=!/usr/sbin/VBoxService
To switch:
sudo service ntp stop
sudo apt remove ntp
sudo service systemd-timesyncd restart
sudo service systemd-timesyncd status
timedatectl