Mikähän on kun kotipalvelimeni kello ei tykkää synkronoida? ntpd on olevinaan käynnistetty ja käytössä. Tässä "ntpq -pn" tuloste, joka näyttää varsin oudolta:
remote refid st t when poll reach delay offset jitter
==============================================================================
194.100.206.70 .INIT. 16 u - 64 0 0.000 0.000 0.000
178.251.154.103 .INIT. 16 u - 64 0 0.000 0.000 0.000
62.237.86.238 .INIT. 16 u - 64 0 0.000 0.000 0.000
194.100.100.152 .INIT. 16 u - 64 0 0.000 0.000 0.000
91.189.94.4 .INIT. 16 u - 64 0 0.000 0.000 0.000
Miksihän nuo ovat jumahtaneet tuohon INIT:iin? Man-sivut eivät oikein asiaa valaisseet, mutta täällä oli selitystä:
http://nlug.ml1.co.uk/2012/01/ntpq-p-output/831Eli tuo INIT olisi "association initialized" mitä se sitten tässä tarkoittaakaan.
"ntpdate -q ntp.ubuntu.com" kertoo, että kello on edellä puolisen toista minuuttia eli synkronoinnille olisi tarvetta:
server 91.189.94.4, stratum 2, offset -95.662568, delay 0.08206
server 91.189.89.199, stratum 2, offset -95.661815, delay 0.07181
14 Jul 22:43:26 ntpdate[21954]: step time server 91.189.89.199 offset -95.661815 sec
$ grep -E '^[^#]' /etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
server ntp.ubuntu.com
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
logfile /var/log/ntpd.log
ja lokitiedosto /var/log/ntpd.log on tyhjä. ntpd:n pysäyttäminen (sudo service ntp stop) ja sitten käsin "sudo ntpd -qddd" ei tuota tulosta vaan jumittaa:
ntpd 4.2.6p5@1.2349-o Mon Apr 13 13:39:46 UTC 2015 (1)
14 Jul 22:48:04 ntpd[23309]: set_process_priority: Leave priority alone: priority_done is <2>
14 Jul 22:48:04 ntpd[23309]: proto: precision = 0.981 usec
loop_config: item 1 freq 0.000000
event at 0 0.0.0.0 c01d 0d kern kernel time sync enabled
Finished Parsing!!
create_sockets(123)
14 Jul 22:48:04 ntpd[23309]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
14 Jul 22:48:04 ntpd[23309]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
created interface #0: fd=16, bfd=-1, name=v4wildcard, flags=0x89, ifindex=0, sin=0.0.0.0, bcast=0.0.0.0, mask=255.255.255.255, Disabled:
14 Jul 22:48:04 ntpd[23309]: Listen and drop on 1 v6wildcard :: UDP 123
created interface #1: fd=17, bfd=-1, name=v6wildcard, flags=0x81, ifindex=0, sin=::, Disabled:
update_interfaces(123)
create_interface(127.0.0.1#123)
14 Jul 22:48:04 ntpd[23309]: Listen normally on 2 lo 127.0.0.1 UDP 123
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00003000 flags 00000001
created interface #2: fd=18, bfd=-1, name=lo, flags=0x5, ifindex=0, sin=127.0.0.1, mask=255.0.0.0, Enabled:
updating interface #2: fd=18, bfd=-1, name=lo, flags=0x5, ifindex=0, sin=127.0.0.1, mask=255.0.0.0, Enabled: new - created
create_interface(192.168.0.120#123)
14 Jul 22:48:04 ntpd[23309]: Listen normally on 3 eth0 192.168.0.120 UDP 123
restrict: op 1 addr 192.168.0.120 mask 255.255.255.255 mflags 00003000 flags 00000001
created interface #3: fd=19, bfd=-1, name=eth0, flags=0x19, ifindex=0, sin=192.168.0.120, bcast=192.168.0.255, mask=255.255.255.0, Enabled:
updating interface #3: fd=19, bfd=-1, name=eth0, flags=0x19, ifindex=0, sin=192.168.0.120, bcast=192.168.0.255, mask=255.255.255.0, Enabled: new - created
create_interface(::1#123)
14 Jul 22:48:04 ntpd[23309]: Listen normally on 4 lo ::1 UDP 123
restrict: op 1 addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
created interface #4: fd=20, bfd=-1, name=lo, flags=0x5, ifindex=1, sin=::1, Enabled:
updating interface #4: fd=20, bfd=-1, name=lo, flags=0x5, ifindex=1, sin=::1, Enabled: new - created
create_interface(fe80::223:54ff:fe0a:591f#123)
14 Jul 22:48:04 ntpd[23309]: Listen normally on 5 eth0 fe80::223:54ff:fe0a:591f UDP 123
restrict: op 1 addr fe80::223:54ff:fe0a:591f mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
created interface #5: fd=21, bfd=-1, name=eth0, flags=0x11, ifindex=2, sin=fe80::223:54ff:fe0a:591f, Enabled:
updating interface #5: fd=21, bfd=-1, name=eth0, flags=0x11, ifindex=2, sin=fe80::223:54ff:fe0a:591f, Enabled: new - created
14 Jul 22:48:04 ntpd[23309]: peers refreshed
create_sockets: Total interfaces = 6
14 Jul 22:48:04 ntpd[23309]: Listening on routing socket on fd #22 for interface updates
io_open_sockets: maxactivefd 22
auth_setkey: key 65535 type 4 len 16 637a7ac3e570a8aa73feeee6f36acb42
getnetnum given 0.0.0.0, got 0.0.0.0
getnetnum given 0.0.0.0, got 0.0.0.0
restrict: op 1 addr 0.0.0.0 mask 0.0.0.0 mflags 00000000 flags 000005d0
getnetnum given ::, got ::
getnetnum given ::, got ::
restrict: op 1 addr :: mask :: mflags 00000000 flags 000005d0
getnetnum given 127.0.0.1, got 127.0.0.1
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00000000 flags 00000000
getnetnum given ::1, got ::1
restrict: op 1 addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00000000 flags 00000000
14 Jul 22:48:04 ntpd[23309]: Cannot open log file /var/log/ntpd.log
newpeer: cast flags: 0x1 for address: 83.150.85.34
newpeer: using fd 19 and our addr 192.168.0.120
key_expire: at 0 associd 40338
peer_clear: at 0 next 1 associd 40338 refid INIT
event at 0 83.150.85.34 8011 81 mobilize assoc 40338
newpeer: 192.168.0.120->83.150.85.34 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
newpeer: cast flags: 0x1 for address: 194.100.2.198
newpeer: using fd 19 and our addr 192.168.0.120
key_expire: at 0 associd 40339
peer_clear: at 0 next 2 associd 40339 refid INIT
event at 0 194.100.2.198 8011 81 mobilize assoc 40339
newpeer: 192.168.0.120->194.100.2.198 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
newpeer: cast flags: 0x1 for address: 62.236.120.71
newpeer: using fd 19 and our addr 192.168.0.120
key_expire: at 0 associd 40340
peer_clear: at 0 next 3 associd 40340 refid INIT
event at 0 62.236.120.71 8011 81 mobilize assoc 40340
newpeer: 192.168.0.120->62.236.120.71 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
newpeer: cast flags: 0x1 for address: 77.86.199.86
newpeer: using fd 19 and our addr 192.168.0.120
key_expire: at 0 associd 40341
peer_clear: at 0 next 4 associd 40341 refid INIT
event at 0 77.86.199.86 8011 81 mobilize assoc 40341
newpeer: 192.168.0.120->77.86.199.86 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
newpeer: cast flags: 0x1 for address: 91.189.94.4
newpeer: using fd 19 and our addr 192.168.0.120
key_expire: at 0 associd 40342
peer_clear: at 0 next 5 associd 40342 refid INIT
event at 0 91.189.94.4 8011 81 mobilize assoc 40342
newpeer: 192.168.0.120->91.189.94.4 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
event at 0 0.0.0.0 c016 06 restart
loop_config: item 2 freq 1000000000.000000
event at 0 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
local_clock: mu 0 state 1 poll 3 count 0
event at 0 0.0.0.0 c011 01 freq_not_set
sendpkt(19, dst=83.150.85.34, src=192.168.0.120, ttl=0, len=48)
transmit: at 1 192.168.0.120->83.150.85.34 mode 3 len 48
poll_update: at 1 83.150.85.34 poll 6 burst 0 retry 2 head 62 early 2 next 67
auth_agekeys: at 1 keys 1 expired 0
timer: interface update
update_interfaces(123)
sendpkt(19, dst=194.100.2.198, src=192.168.0.120, ttl=0, len=48)
transmit: at 2 192.168.0.120->194.100.2.198 mode 3 len 48
poll_update: at 2 194.100.2.198 poll 6 burst 0 retry 2 head 62 early 2 next 65
sendpkt(19, dst=62.236.120.71, src=192.168.0.120, ttl=0, len=48)
transmit: at 3 192.168.0.120->62.236.120.71 mode 3 len 48
poll_update: at 3 62.236.120.71 poll 6 burst 0 retry 2 head 62 early 2 next 67
sendpkt(19, dst=77.86.199.86, src=192.168.0.120, ttl=0, len=48)
transmit: at 4 192.168.0.120->77.86.199.86 mode 3 len 48
poll_update: at 4 77.86.199.86 poll 6 burst 0 retry 2 head 62 early 2 next 66
sendpkt(19, dst=91.189.94.4, src=192.168.0.120, ttl=0, len=48)
transmit: at 5 192.168.0.120->91.189.94.4 mode 3 len 48
poll_update: at 5 91.189.94.4 poll 6 burst 0 retry 2 head 62 early 2 next 65
ja jonkun ajan päästä tulostelee noita lisää, mutta ei lopeta suoritusta tai säädä kelloa.
Kellon olisi tällä palvelimella kuitenkin syytä olla ajassa, koska ko. palvelin vastaa TV-ohjelmien tallentamisesta. Ehdotuksia?
Muokkaus: Niin ja käsin saan kuitenkin tuon likimain aikaan:
$ sudo date -s 2015-07-14T22:53:00+0300
ti 14.7.2015 22.53.00 +0300
$ date
ti 14.7.2015 22.53.03 +0300
$ ntpdate -q ntp.ubuntu.com
server 91.189.89.199, stratum 2, offset 0.277197, delay 0.07176
server 91.189.94.4, stratum 2, offset 0.275289, delay 0.08429
14 Jul 22:53:15 ntpdate[25237]: adjust time server 91.189.89.199 offset 0.277197 sec
mutta tuonkaan jälkeen ntpd ei saa (käsin ajettuna) asetettua kelloa kohdalleen vaan tulosteet ovat samat.
Muokkaus 2: Jahas... Nähtävästi kello taitaa driftata, koska offset tuohon ntp.ubuntu.comiin on jo melkein hävinnyt kymmenessä minuutissa. Mitähän tuo lienee huomenna...
$ date
ti 14.7.2015 23.04.14 +0300
$ ntpdate -q ntp.ubuntu.com
server 91.189.89.199, stratum 2, offset 0.083564, delay 0.07068
server 91.189.94.4, stratum 2, offset 0.083637, delay 0.08202
14 Jul 23:04:21 ntpdate[28637]: adjust time server 91.189.89.199 offset 0.083564 sec
Pitäisi siis varmaankin tuota korjata ensin.
Muokkaus 3: Hmph...
$ date; ntpdate -q ntp.ubuntu.com
ke 15.7.2015 13.51.21 +0300
server 91.189.94.4, stratum 2, offset -15.344430, delay 0.08185
server 91.189.89.199, stratum 2, offset -15.344345, delay 0.07191
15 Jul 13:51:27 ntpdate[25026]: step time server 91.189.89.199 offset -15.344345 sec
Muokkaus RATKAISTU:
Kellohan huiteli missä sattuu ja ntpd ei tehnyt töitään. En saanut ntpd:tä korjattua, mutta vaihdoin sen OpenNTPD:hen, joka toimii mainiosti. Nyt kello pysyy ajassaan.