LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-12-2017, 09:44 PM   #1
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 566

Rep: Reputation: 40
Question ntp, timedatectl ...


all i'm trying to do is to keep my machine synced with an ntp server.
apparently just enabling ntp service is not good enough/not right/not modern/not prestige/not something else.
And i should be using the timedatectl with systemd-timesyncd.

i read the manual and a few articles and clearly i'm not understanding how it should work.

My understanding:
instead of ntp i should use systemd-timesyncd together with timedatectl. To get time/date sync with network ntp service, i need to (remove ntp package first) enable systemd-timesyncd service and enable syncing of the date/time in the timedatectl.

Question:
and why once i do the above systemd-timesync is dead? isn't it suppose to run and keep the time in sync ??
and why do i get :
Network time on: yes
NTP synchronized: yes

even-though the systemd service is dead/idle ?


Code:
[root@server ~]# systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2017-11-12 21:33:18 EST; 22s ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 14304 (systemd-timesyn)
   Status: "Synchronized to time server 204.2.134.164:123 (0.fedora.pool.ntp.org)."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/systemd-timesyncd.service
           └─14304 /usr/lib/systemd/systemd-timesyncd

Nov 12 21:33:18 server.home systemd[1]: Starting Network Time Synchronization...
Nov 12 21:33:18 server.home systemd[1]: Started Network Time Synchronization.
Nov 12 21:33:19 server.home systemd-timesyncd[14304]: Synchronized to time server 204.2.134.164:123 (0.fedora.pool.ntp.org).
[root@server ~]# timedatectl set-ntp true
[root@server ~]# 
[root@server ~]# 
[root@server ~]# 
[root@server ~]# systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: disabled)
   Active: inactive (dead) since Sun 2017-11-12 21:33:53 EST; 4s ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 14304 (code=exited, status=0/SUCCESS)
   Status: "Idle."

Nov 12 21:33:18 server.home systemd[1]: Starting Network Time Synchronization...
Nov 12 21:33:18 server.home systemd[1]: Started Network Time Synchronization.
Nov 12 21:33:19 server.home systemd-timesyncd[14304]: Synchronized to time server 204.2.134.164:123 (0.fedora.pool.ntp.org).
Nov 12 21:33:53 server.home systemd[1]: Stopping Network Time Synchronization...
Nov 12 21:33:53 server.home systemd[1]: Stopped Network Time Synchronization.
[root@server ~]# timedatectl status
      Local time: Sun 2017-11-12 21:34:04 EST
  Universal time: Mon 2017-11-13 02:34:04 UTC
        RTC time: Mon 2017-11-13 02:33:44
       Time zone: America/New_York (EST, -0500)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

Last edited by DBabo; 11-12-2017 at 09:45 PM.
 
Old 11-12-2017, 10:08 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,016

Rep: Reputation: 4102Reputation: 4102Reputation: 4102Reputation: 4102Reputation: 4102Reputation: 4102Reputation: 4102Reputation: 4102Reputation: 4102Reputation: 4102Reputation: 4102
Don't know wher you got that idea. In my F26 it's all handled automagically by chronyd.
Set options in Settings -> Date and Time, and off you go.

I should add this is gnome.

Last edited by syg00; 11-12-2017 at 10:09 PM. Reason: gnome
 
1 members found this post helpful.
Old 11-12-2017, 10:30 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,006

Rep: Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683
systemd-timesyncd uses sntp which is a less complex implementation of the ntp protocol. It is a client only.
You can use either service but they can not run at the same time. Is ntp installed and running?


https://en.wikipedia.org/wiki/Network_Time_Protocol

Last edited by michaelk; 11-12-2017 at 10:34 PM.
 
Old 11-12-2017, 11:52 PM   #4
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 566

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by michaelk View Post
systemd-timesyncd uses sntp which is a less complex implementation of the ntp protocol. It is a client only.
You can use either service but they can not run at the same time. Is ntp installed and running?


https://en.wikipedia.org/wiki/Network_Time_Protocol
I took ntp out (uninstalled). What i dont underatand is why after enabling ntp in datetiemectl the systemd service dies?// see the code above. And sorry for typeoff im on mobile.
 
Old 11-12-2017, 11:55 PM   #5
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 566

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by syg00 View Post
Don't know wher you got that idea. In my F26 it's all handled automagically by chronyd.
Set options in Settings -> Date and Time, and off you go.

I should add this is gnome.
Sorry, not sure what idea you r referring to. Im on f26 too, and assumed that im in sync , but i guess, i forgot to enable when upgraded(odd actually, since i always do that).
I cant see how its done in gui tools at the moment, and to be frank, more curious what iz it under the hood now.

Last edited by DBabo; 11-12-2017 at 11:57 PM. Reason: fat fingers on mobile
 
Old 11-13-2017, 08:32 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,006

Rep: Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683Reputation: 5683
syg00 is correct chronyd is the default ntp client and therefore the reason why timesyncd is inactive.

https://fedoraproject.org/wiki/Featu...ronyDefaultNTP

For chronyd's status
systemctl status chronyd
 
1 members found this post helpful.
Old 11-13-2017, 10:10 AM   #7
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 566

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by michaelk View Post
syg00 is correct chronyd is the default ntp client and therefore the reason why timesyncd is inactive.

https://fedoraproject.org/wiki/Featu...ronyDefaultNTP

For chronyd's status
systemctl status chronyd

Arh, i didnt read syg00's post properly! Thank you for pointing out. Now everyrhing adds up. Thank you gents!
 
Old 11-13-2017, 02:38 PM   #8
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 566

Original Poster
Rep: Reputation: 40
looks like chrony is the way forward.
https://access.redhat.com/documentat...e_chrony_suite
 
  


Reply

Tags
datetimectl, fedora, ntp, systemd-timesync


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTP Server Using the NTP Time not External Servers or Pools jackgun Red Hat 3 11-04-2016 03:37 PM
[SOLVED] error when such "timedatectl set-local-rtc 1" in systemd lfs 7.9 chapter 7.5 Louise.Yosre Linux From Scratch 1 07-31-2016 12:18 PM
[SOLVED] some issues with CentOSv7 and NTP with timedatectl set-ntp yes lleb Linux - Server 3 03-30-2015 09:45 PM
[SOLVED] NTP configuration in client to synchronize with NTP server. antnish Linux - General 12 04-01-2013 02:49 PM
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 08:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration