Below describes the steps to remove the setup of legacy NTP configuration, and setup the new light weight “system-timedated” configuration to synchronise your system’s clock from the Internet.
First shutdown the NTP daemon process, disable the auto-start setup and deinstall the packages with the following commands on the shell prompt:
Code: Select all
sudo systemctl stop ntp
sudo systemctl disable ntp
sudo apt-get -y remove ntp
sudo rm -f /etc/init.d/ntp
sudo rm -f /etc/default/ntp
sudo rm -f /etc/rc?.d/{S,K}??ntp
sudo rm -f /etc/ntp.conf
sudo rm -f /etc/cron.daily/ntp
sudo rm -f /var/log/ntpstats
Code: Select all
[Time]
NTP=0.europe.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
With your favourite text editor, modify the file “/etc/rc.local” to have the following contents:
Code: Select all
[ ! -e /var/lib/systemd/clock -a "`systemctl is-active systemd-timesyncd | grep -i active`" ] && timedatectl set-ntp 1 > /dev/null 2>&1
sleep 2
To finally enable the automatic start-up of the system’s clock synchronisation during boot-up using the "systemd-timesyncd" service, execute the following commands on the shell prompt:
Code: Select all
sudo systemctl enable systemd-timesyncd
sudo systemctl start systemd-timesyncd
sudo timedatectl set-ntp 1
To verify its proper operation, after a little while, simply execute the following command on the shell prompt:
Code: Select all
timedatectl
Code: Select all
Local time: Wed 2017-03-18 09:44:46 CET
Universal time: Wed 2017-03-18 08:44:46 UTC
RTC time: Wed 2017-03-18 08:44:46
Time zone: … (CET, +0100)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
Hope this helps!