Bug 220563 - NTPd does not synchronize the time with a long (for a couple of weeks) disconnecting the virtual machine
Summary: NTPd does not synchronize the time with a long (for a couple of weeks) discon...
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-08 15:47 UTC by Vladyslav V. Prodan
Modified: 2018-07-04 14:33 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladyslav V. Prodan 2017-07-08 15:47:35 UTC
NTPd does not synchronize the time with a long (for a couple of weeks) disconnecting the virtual machine

# env LC_ALL=C date
Tue Jul  4 21:19:47 EEST 2017

# service ntpd onefetch
# service ntpd restart
ntpd not running? (check /var/run/ntpd.pid).
Starting ntpd.

In logs:
Jul  4 21:20:21 core ntpd[1762]: ntpd 4.2.8p10-a (1): Starting
Jul  4 21:20:22 core ntpd[1763]: restrict: 'monitor' cannot be disabled while 'limited' is enabled
Jul  4 21:20:22 core ntpd[1763]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): good hash signature
Jul  4 21:20:22 core ntpd[1763]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): loaded, expire=2017-12-28T00:00:00Z last=2017-01-01T00:00:00Z ofs=37

After entering the following commands, ntpd worked fine:

# ntpdate time.in.ua
 8 Jul 18:44:14 ntpdate[1818]: step time server 62.149.0.30 offset 336055.068582 sec

# service ntpd restart
ntpd not running? (check /var/run/ntpd.pid).
Starting ntpd.

# env LC_ALL=C date
Sat Jul  8 18:45:58 EEST 2017

# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.freebsd.pool. .POOL.          16 p    -   64    0    0.000    0.000   0.002
#194.54.80.30    204.108.231.32   3 u   41   64    3    2.714   -2.997   0.207
*62.149.0.30     .GPS.            1 u   42   64    3   10.397    0.193   0.396
#2001:67c:440:40 193.11.166.20    2 u   45   64    3   92.070   -5.164   0.740
+193.27.209.20   31.28.161.68     2 u   46   64    3   21.624   -0.455   0.294
+193.27.208.100  .PPS.            1 u   44   64    3   20.100   -1.018   0.334
-91.198.10.1     62.149.0.30      2 u   40   64    3   17.699   -1.543   0.274
-91.236.251.12   193.11.166.20    2 u   42   64    3   34.316   -0.482   1.414
-195.78.244.34   62.149.0.30      2 u   39   64    3    1.484   -0.906   0.470


FreeBSD 11.1-PRERELEASE #0 r318606: Mon May 22 14:28:27 EEST 2017

# egrep -i ntp /etc/rc.conf
ntpd_enable="YES"

# egrep -v '^$|^#' /etc/ntp.conf
tos minclock 3 maxclock 6
pool 0.freebsd.pool.ntp.org iburst
restrict    default limited kod nomodify notrap noquery nopeer
restrict -6 default limited kod nomodify notrap noquery nopeer
restrict    source  limited kod nomodify notrap noquery
restrict 127.0.0.1
restrict -6 ::1
leapfile "/var/db/ntpd.leap-seconds.list"
server 0.ua.pool.ntp.org iburst maxpoll 9
server 1.ua.pool.ntp.org iburst maxpoll 9
server 2.ua.pool.ntp.org iburst maxpoll 9
server 3.ua.pool.ntp.org iburst maxpoll 9
restrict default ignore
restrict -6 default ignore
restrict 0.ua.pool.ntp.org noquery notrap
restrict 1.ua.pool.ntp.org noquery notrap
restrict 2.ua.pool.ntp.org noquery notrap
restrict 3.ua.pool.ntp.org noquery notrap
statistics peerstats
statistics loopstats
statistics clockstats
disable monitor
Comment 1 Yuri Pankov 2017-12-03 03:11:55 UTC
Not a bug -- see the '-g' option description in ntpd(8) and 'ntpd_sync_on_start' description in rc.conf(5).
Comment 2 Ian Lepore freebsd_committer freebsd_triage 2018-07-04 14:33:27 UTC
By design, ntpd will not step the clock further than about 15 minutes without permission to do so.  To give it permission, set ntpd_sync_on_start=YES in rc.conf.