Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] timedatectl shows "Network time on: no"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
PQPGuy
n00b
n00b


Joined: 04 Sep 2017
Posts: 31

PostPosted: Thu Sep 07, 2017 8:06 am    Post subject: [SOLVED] timedatectl shows "Network time on: no" Reply with quote

I am using net-misc/chrony. timedatectl says

Code:
Network time on: no

Does this mean my machine is not being sync'd with time servers? If so, anybody knows how to fix or troubleshoot this? My /etc/chrony/chrony.conf is

Code:
pool pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
cmdport 0
pool 0.de.pool.ntp.org iburst
pool 1.de.pool.ntp.org iburst
pool 2.de.pool.ntp.org iburst
pool 3.de.pool.ntp.org iburst

Many thanks.

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]


Last edited by PQPGuy on Fri Sep 08, 2017 7:39 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7237
Location: almost Mile High in the USA

PostPosted: Thu Sep 07, 2017 1:21 pm    Post subject: Reply with quote

Just like all other things, systemd ate the functionality of chrony/ntpd in client mode.

What you want to do is enable systemd's ntp functionality by editing /etc/systemd/timesyncd.conf to include your ntp servers and enable ntp by

# timedatectl set-ntp true

Ref: https://wiki.archlinux.org/index.php/systemd-timesyncd
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1755
Location: United Kingdom

PostPosted: Thu Sep 07, 2017 1:35 pm    Post subject: Reply with quote

If you're using ntpd or chronyd instead of timesyncd, you don't want the timesyncd service running. The output of the timedatectl command shows 'Network time on: no' if timesyncd specifically is not running, so it looks to me like your installation is fine. You can check by using the date command to set the system clock to e.g. half an hour in the future then use the timedatectl command to check if the system clock time returns to the real time:

Code:
$ timedatectl
      Local time: Thu 2017-09-07 14:17:38 BST
  Universal time: Thu 2017-09-07 13:17:38 UTC
        RTC time: Thu 2017-09-07 13:17:37
       Time zone: Europe/London (BST, +0100)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no
$ systemctl | grep time
  systemd-timesyncd.service                                             loaded active running   Network Time Synchronization
  time-sync.target                                                      loaded active active    System Time Synchronized
  timers.target                                                         loaded active active    Timers
  systemd-tmpfiles-clean.timer                                          loaded active waiting   Daily Cleanup of Temporary Directories
$ systemctl | grep chrony
$ sudo timedatectl set-ntp no
Password:
$ timedatectl
      Local time: Thu 2017-09-07 14:19:48 BST
  Universal time: Thu 2017-09-07 13:19:48 UTC
        RTC time: Thu 2017-09-07 13:19:46
       Time zone: Europe/London (BST, +0100)
 Network time on: no
NTP synchronized: yes
 RTC in local TZ: no
$ sudo systemctl start chronyd
$ systemctl | grep chrony
  chronyd.service                                                       loaded active running   Chrony Network Time Service
$ timedatectl
      Local time: Thu 2017-09-07 14:20:34 BST
  Universal time: Thu 2017-09-07 13:20:34 UTC
        RTC time: Thu 2017-09-07 13:20:33
       Time zone: Europe/London (BST, +0100)
 Network time on: no
NTP synchronized: yes
 RTC in local TZ: no
$ date
Thu  7 Sep 14:22:45 BST 2017
$ sudo date 09071454
Thu  7 Sep 14:54:00 BST 2017
$ date
Thu  7 Sep 14:54:03 BST 2017
$ systemctl | grep timesyncd
$ date
Thu  7 Sep 14:25:17 BST 2017
$ timedatectl
      Local time: Thu 2017-09-07 14:25:30 BST
  Universal time: Thu 2017-09-07 13:25:30 UTC
        RTC time: Thu 2017-09-07 13:25:29
       Time zone: Europe/London (BST, +0100)
 Network time on: no
NTP synchronized: no
 RTC in local TZ: no
$ timedatectl
      Local time: Thu 2017-09-07 14:26:03 BST
  Universal time: Thu 2017-09-07 13:26:03 UTC
        RTC time: Thu 2017-09-07 13:26:02
       Time zone: Europe/London (BST, +0100)
 Network time on: no
NTP synchronized: yes
 RTC in local TZ: no
$

Notice in the output pasted above that the installation was originally using timesyncd then I switched it to use chronyd. Notice above that the output of the timedatectl command now shows 'Network time on: no' but chronyd corrected the system clock time when I set it to be 32 minutes in the future.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
PQPGuy
n00b
n00b


Joined: 04 Sep 2017
Posts: 31

PostPosted: Fri Sep 08, 2017 7:37 am    Post subject: Reply with quote

Quote:
enable systemd's ntp functionality by editing /etc/systemd/timesyncd.conf to include your ntp servers and enable ntp by

# timedatectl set-ntp true

Thank you, guys. This does it!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum