Setup guides should include setup for systemd/timesyncd

2,200 views
Skip to first unread message

Michael Rothwell

unread,
Mar 25, 2018, 9:29:40 PM3/25/18
to public-ntp-discuss
https://developers.google.com/time/guides

e.g.,

1) make  /etc/systemd/timesyncd.conf look like:


2) enable ntp

# timedatectl set-ntp true

3) restart timesyncd

# systemctl restart systemd-timesyncd.service

4) check the status ("Synchronized to time server..." should say time1.google.com or similar)

# systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: active (running) since Mon 2018-03-26 01:20:53 UTC; 5min ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 4212 (systemd-timesyn)
   Status: "Synchronized to time server 216.239.35.0:123 (time1.google.com)."
    Tasks: 2
   Memory: 268.0K
      CPU: 8ms
   CGroup: /system.slice/systemd-timesyncd.service
           └─4212 /lib/systemd/systemd-timesyncd

Mar 26 01:20:53 b systemd[1]: Starting Network Time Synchronization...
Mar 26 01:20:53 b systemd[1]: Started Network Time Synchronization.
Mar 26 01:20:53 b systemd-timesyncd[4212]: Synchronized to time server 216.239.35.0:123 (time1.google.com).

5) timedatectl should report network time on/synced

# timedatectl status
      Local time: Mon 2018-03-26 01:26:41 UTC
  Universal time: Mon 2018-03-26 01:26:41 UTC
        RTC time: Mon 2018-03-26 01:26:41
       Time zone: Etc/UTC (UTC, +0000)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

Reply all
Reply to author
Forward
0 new messages