Portál AbcLinuxu, 15. května 2025 08:40
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help driftfile /var/lib/ntp/ntp.drift # Leap seconds definition provided by tzdata leapfile /usr/share/zoneinfo/leap-seconds.list logfile /var/log/ntp.log # Enable this if you want statistics to be logged. #statsdir /var/log/ntpstats/ 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 # You do need to talk to an NTP server or two (or three). #server ntp.your-provider.example server ntp.nic.cz server tik.cesnet.cz # pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will # pick a different set every time it starts up. Please consider joining the #pool 0.debian.pool.ntp.org iburst #pool 1.debian.pool.ntp.org iburst #pool 2.debian.pool.ntp.org iburst #pool 3.debian.pool.ntp.org iburst # Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for # details. The web page # might also be helpful. # # Note that "restrict" applies to both servers and clients, so a configuration # that might be intended to block requests from certain clients could also end # up blocking replies from your own upstream servers. # By default, exchange time with everybody, but don't allow configuration. restrict -4 default kod notrap nomodify nopeer noquery limited restrict -6 default kod notrap nomodify nopeer noquery limited # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 restrict ::1 # Needed for adding pool entries restrict source notrap nomodify noquery # Clients from this (example!) subnet have unlimited access, but only if # cryptographically authenticated. #restrict 192.168.123.0 mask 255.255.255.0 notrust restrict 192.168.0.0 mask 255.255.255.0 notrap nomodify # If you want to provide time to your local subnet, change the next line. # (Again, the address is an example only.) #broadcast 192.168.123.255 # If you want to listen to time broadcasts on your local subnet, de-comment the # next lines. Please do this only if you trust everybody on the network! #disable auth #broadcastclientVe firewallu mám povoleno udp 123 na firewall.
12 Aug 18:23:34 ntpd[3378]: kernel reports TIME_ERROR: 0x4041: Clock Unsynchronized 12 Aug 18:23:34 ntpd[3378]: kernel reports TIME_ERROR: 0x4041: Clock UnsynchronizedKdyž se podivám přes systemctl na status tváří se ve v pořádku:
ntp.service - Network Time Service Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2020-08-12 18:23:34 CEST; 4min 23s ago Docs: man:ntpd(8) Process: 3372 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=0/SUCCESS) Main PID: 3378 (ntpd) Tasks: 2 (limit: 4915) Memory: 1.5M CGroup: /system.slice/ntp.service └─3378 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /run/ntp.conf.dhcp -u 106:112 srp 12 18:23:34 LSPC02 systemd[1]: Starting Network Time Service... srp 12 18:23:34 LSPC02 ntpd[3372]: ntpd 4.2.8p12@1.3728-o (1): Starting srp 12 18:23:34 LSPC02 ntpd[3372]: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /run/ntp.conf.dhcp -u 106:112 srp 12 18:23:34 LSPC02 systemd[1]: Started Network Time Service. srp 12 18:23:34 LSPC02 ntpd[3378]: proto: precision = 0.070 usec (-24) srp 12 18:23:34 LSPC02 ntpd[3378]: leapsecond file ('/usr/share/zoneinfo/leap-seconds.list'): good hash signature srp 12 18:23:34 LSPC02 ntpd[3378]: leapsecond file ('/usr/share/zoneinfo/leap-seconds.list'): loaded, expire=2020-12-28T00:00:00Z last=20 srp 12 18:23:34 LSPC02 ntpd[3378]: switching logging to file /var/log/ntp.logUž jsem celekm bezradný. Tímto děkuji za jakoukoliv radu co by mě mohla nasměrovat k řešení.
/run/ntp.conf.dhcp
viz status ntp.service
.
Take ntpd odmita synchronizovat cas pokud jsou lokalni hodiny prilis posunute proti synchronizacnimu serveru.
Informace o tom co to dela by mely byt v /var/log/ntp.log
Taky se muze hodit:
Zobrazeni stavu ntpd
ntpq -c sysinfo
Informace o peerech, s kterymi se bavi
ntpq -c lpeers
11 Aug 20:30:45 ntpd[7878]: Listening on routing socket on fd #31 for interface updates 11 Aug 20:30:45 ntpd[7878]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized 11 Aug 20:30:45 ntpd[7878]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized 12 Aug 18:23:34 ntpd[7878]: ntpd exiting on signal 15 (Terminated) 12 Aug 18:23:34 ntpd[3378]: Listen and drop on 0 v6wildcard [::]:123 12 Aug 18:23:34 ntpd[3378]: Listen and drop on 1 v4wildcard 0.0.0.0:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 2 lo 127.0.0.1:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 3 eno1 172.30.18.15:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 4 enp4s0f0 10.1.0.254:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 5 bond0 192.168.0.1:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 6 enp4s0f0.20 172.100.200.30:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 7 tun0 192.168.44.1:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 8 lo [::1]:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 9 eno1 [2a07:bc0:4ff:4:5265:f3ff:fe7a:3ac4]:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 10 eno1 [fe80::5265:f3ff:fe7a:3ac4%2]:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 11 enp4s0f0 [fe80::e61f:13ff:fefc:6993%5]:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 12 bond0 [fe80::e61f:13ff:fefc:6991%7]:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 13 enp4s0f0.20 [fe80::e61f:13ff:fefc:6993%9]:123 12 Aug 18:23:34 ntpd[3378]: Listen normally on 14 tun0 [fe80::ddda:694a:cea9:528b%10]:123 12 Aug 18:23:34 ntpd[3378]: Listening on routing socket on fd #31 for interface updates 12 Aug 18:23:34 ntpd[3378]: kernel reports TIME_ERROR: 0x4041: Clock Unsynchronized 12 Aug 18:23:34 ntpd[3378]: kernel reports TIME_ERROR: 0x4041: Clock Unsynchronizedntpq -c sysinfo hlasi toto:
associd=0 status=c016 leap_alarm, sync_unspec, 1 event, restart, system peer: 0.0.0.0:0 system peer mode: unspec leap indicator: 11 stratum: 16 log2 precision: -24 root delay: 0.000 root dispersion: 51.525 reference ID: INIT reference time: (no time) system jitter: 0.000000 clock jitter: 0.000 clock wander: 0.000 broadcast delay: -50.000 symm. auth. delay: 0.000ntpq -c lpeers toto:
No association ID's returned
remote refid st t when poll reach delay offset jitter ============================================================================== *ntp.nic.cz .GPS. 1 u 662 1024 377 1.839 0.054 0.040 +tik.cesnet.cz .ATOM. 1 u 28 1024 377 2.432 0.131 0.084Bohuzel nemam nikde debian 10, ale v deb 9 ten soubor /run/ntp.conf.dhcp vytvari skript /etc/dhcp/dhclient-exit-hooks.d/ntp Dle toho co tam je napsane tak staci odtranit ten dhcp config a shdpc exit hook (nejspis to bude stejne i v debian 10) Nasledne restartovat ntpd. Predpokladam, ze dhcp atribut pro ntp neeexistoval, vytvoril se dhcp konfig a i po uprave nedoslo k restartu ntpd. Taky lze souhlasit s tim co v diskuzi zaznelo, ze je lepsi pouzit chrony namisto ntod pokud neni cilem vytvorit stratum 1 server.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.