Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[PROBLEM] NTP doesn't work
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Problem: NTP doesn't work
14th Mar, 2018, 10:35 PM
Post: #1
Dzintars Bergs
Unregistered
 
NTP doesn't work
Any ideas why NTP isn't working? NTPD service is running. I cant find any ntp related logs in /var/log.
All latest updates are installed, running on Pi2.

/etc/ntp.conf:
Terminal
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

# 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

# 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: <http://www.pool.ntp.org/join.html>
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 <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# 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


# 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
Quote this message in a reply
15th Mar, 2018, 12:37 AM
Post: #2
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: NTP doesn't work
No idea Dodgy

What's the output of

Code:
ntpq -p
Find all posts by this user
Quote this message in a reply
15th Mar, 2018, 05:08 AM
Post: #3
Dzintars Bergs
Unregistered
 
RE: NTP doesn't work
(15th Mar, 2018 12:37 AM)Nachteule Wrote:  No idea Dodgy

What's the output of

Code:
ntpq -p

Terminal
root@pi2 ~ # ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
localhost: timed out, nothing received
***Request timed out
Quote this message in a reply
15th Mar, 2018, 05:34 AM
Post: #4
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: NTP doesn't work
Oops, can you ping the servers ({0,1,2,3}.debian.pool.ntp.org) ?
Find all posts by this user
Quote this message in a reply
15th Mar, 2018, 05:46 AM
Post: #5
Dzintars Bergs
Unregistered
 
RE: NTP doesn't work
I can ping all of them
Terminal
root@pi2 ~ # ping 0.debian.pool.ntp.org
PING 0.debian.pool.ntp.org (162.210.110.4) 56(84) bytes of data.
64 bytes from resolver1.skyfiberinternet.com (162.210.110.4): icmp_seq=1 ttl=49 time=182 ms
64 bytes from resolver1.skyfiberinternet.com (162.210.110.4): icmp_seq=2 ttl=49 time=185 ms
64 bytes from resolver1.skyfiberinternet.com (162.210.110.4): icmp_seq=3 ttl=49 time=181 ms

Huh
Quote this message in a reply
15th Mar, 2018, 05:57 AM
Post: #6
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: NTP doesn't work
Ok, so next question(s):

Did NTP ever work?

Maybe you have firewall that blocks ntp (in and/or out) packages

I've already read in a different forum (different OS), that there are providers blocking ntp packages and forcing clients to use their own ntp server
Find all posts by this user
Quote this message in a reply
15th Mar, 2018, 06:07 AM
Post: #7
Dzintars Bergs
Unregistered
 
RE: NTP doesn't work
It worked before. Guess I have to check my firewall. Thaks for help!
Quote this message in a reply
15th Mar, 2018, 08:38 PM (This post was last modified: 15th Mar, 2018 08:44 PM by deHakkelaar.)
Post: #8
deHakkelaar Offline
Administrator
******
Posts: 360
Joined: Dec 2012
Reputation: 23
RE: NTP doesn't work
(15th Mar, 2018 05:08 AM)Dzintars Bergs Wrote:  
Terminal
root@pi2 ~ # ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
localhost: timed out, nothing received
***Request timed out

Is the ntp daemon running ?

Code:
sudo status ntp

If not, you can try start here up with:

Code:
sudo start ntp

And check below ones :

Code:
sudo status ntp

Code:
ntpq -p

Code:
sudo zcat /var/log/upstart/ntp.log.1.gz

There are only 10 types of people in the world: those who understand binary, and those who don't
Find all posts by this user
Quote this message in a reply
19th Mar, 2018, 05:23 AM
Post: #9
Dzintars Bergs
Unregistered
 
RE: NTP doesn't work
NTP service is running, that's not the problem.

Upstart log contains only records like those:
Terminal
18 Mar 21:13:45 ntpd[4809]: Soliciting pool server 89.111.54.85
18 Mar 21:14:12 ntpd[4809]: Soliciting pool server 103.242.70.4
18 Mar 21:14:25 ntpd[4809]: Soliciting pool server 89.111.15.218
18 Mar 21:14:37 ntpd[4809]: Soliciting pool server 2001:738:0:810:1::162
18 Mar 21:14:52 ntpd[4809]: Soliciting pool server 84.245.235.193
18 Mar 21:15:19 ntpd[4809]: Soliciting pool server 195.122.19.73
18 Mar 21:15:32 ntpd[4809]: Soliciting pool server 178.16.23.50
18 Mar 21:15:41 ntpd[4809]: Soliciting pool server 2a02:e00:ffec:2d9::1
18 Mar 21:15:56 ntpd[4809]: Soliciting pool server 84.245.235.193
18 Mar 21:16:26 ntpd[4809]: Soliciting pool server 85.254.217.235
18 Mar 21:16:39 ntpd[4809]: Soliciting pool server 89.111.15.218
18 Mar 21:16:47 ntpd[4809]: Soliciting pool server 2a00:d880:5:93b::7777
18 Mar 21:17:01 ntpd[4809]: Soliciting pool server 89.111.54.85
18 Mar 21:17:33 ntpd[4809]: Soliciting pool server 195.122.19.73
18 Mar 21:17:43 ntpd[4809]: Soliciting pool server 178.16.23.50
18 Mar 21:17:54 ntpd[4809]: Soliciting pool server 85.254.216.1
18 Mar 21:18:08 ntpd[4809]: Soliciting pool server 51.255.33.56
18 Mar 21:18:40 ntpd[4809]: Soliciting pool server 85.254.217.235
18 Mar 21:18:48 ntpd[4809]: Soliciting pool server 89.111.15.218
18 Mar 21:18:58 ntpd[4809]: Soliciting pool server 84.245.235.193
18 Mar 21:19:12 ntpd[4809]: Soliciting pool server 72.14.183.39
18 Mar 21:19:44 ntpd[4809]: Soliciting pool server 178.16.23.50
18 Mar 21:19:55 ntpd[4809]: Soliciting pool server 195.122.19.73
18 Mar 21:20:04 ntpd[4809]: Soliciting pool server 2a01:4f8:221:43c5::2
18 Mar 21:20:16 ntpd[4809]: Soliciting pool server 31.28.161.68
18 Mar 21:20:51 ntpd[4809]: Soliciting pool server 89.111.54.85
18 Mar 21:21:02 ntpd[4809]: Soliciting pool server 83.241.47.64
Quote this message in a reply
19th Mar, 2018, 06:03 AM
Post: #10
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: NTP doesn't work
And you don't have messages like this in ntp.log?

Code:
18 Mar 21:00:13 ntpd[5066]: ntpd 4.2.8p10@1.3728-o Sun Feb 25 22:00:44 UTC 2018 (1): Starting
18 Mar 21:00:13 ntpd[5066]: Command line: /usr/sbin/ntpd -n -g -L -U 1 -u 102:104
18 Mar 21:00:13 ntpd[5066]: proto: precision = 0.625 usec (-21)
restrict 0.0.0.0: KOD does nothing without LIMITED.
18 Mar 21:00:13 ntpd[5066]: restrict 0.0.0.0: KOD does nothing without LIMITED.
restrict ::: KOD does nothing without LIMITED.
18 Mar 21:00:13 ntpd[5066]: restrict ::: KOD does nothing without LIMITED.
18 Mar 21:00:13 ntpd[5066]: restrict: ignoring line 39, mask '::' unusable.
18 Mar 21:00:13 ntpd[5066]: unable to bind to wildcard address 0.0.0.0 - another process may be running - EXITING
Find all posts by this user
Quote this message in a reply
21st Mar, 2018, 11:04 PM
Post: #11
Dzintars Bergs
Unregistered
 
RE: NTP doesn't work
(19th Mar, 2018 06:03 AM)Nachteule Wrote:  And you don't have messages like this in ntp.log?

No, only "Soliciting pool server...".
Quote this message in a reply
22nd Mar, 2018, 05:29 AM
Post: #12
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: NTP doesn't work
(21st Mar, 2018 11:04 PM)Dzintars Bergs Wrote:  
(19th Mar, 2018 06:03 AM)Nachteule Wrote:  And you don't have messages like this in ntp.log?

No, only "Soliciting pool server...".

Sounds for me that ntp never has been started

Could you please run commands as follows:

Code:
sudo stop ntp
sudo rm -f /var/log/upstart/ntp.log
sudo start ntp
sudo cat /var/log/upstart/ntp.log

The output should look like this

Terminal

root@kmxbilr2 /etc/default # stop ntp
ntp stop/waiting
root@kmxbilr2 /etc/default # rm -f /var/log/upstart/ntp.log
root@kmxbilr2 /etc/default # start ntp
ntp start/running, process 7895
root@kmxbilr2 /etc/default # cat /var/log/upstart/ntp.log
21 Mar 20:25:37 ntpd[7895]: ntpd 4.2.8p10@1.3728-o Sun Feb 25 22:00:44 UTC 2018 (1): Starting
21 Mar 20:25:37 ntpd[7895]: Command line: /usr/sbin/ntpd -n -g -L -U 1 -u 102:104
21 Mar 20:25:37 ntpd[7895]: proto: precision = 0.677 usec (-20)
restrict 0.0.0.0: KOD does nothing without LIMITED.
21 Mar 20:25:37 ntpd[7895]: restrict 0.0.0.0: KOD does nothing without LIMITED.
restrict ::: KOD does nothing without LIMITED.
21 Mar 20:25:37 ntpd[7895]: restrict ::: KOD does nothing without LIMITED.
21 Mar 20:25:37 ntpd[7895]: restrict: ignoring line 39, mask '::' unusable.
21 Mar 20:25:37 ntpd[7895]: Listen and drop on 0 v4wildcard 0.0.0.0:123
21 Mar 20:25:37 ntpd[7895]: Listen normally on 1 lo 127.0.0.1:123
21 Mar 20:25:37 ntpd[7895]: Listen normally on 2 eth0 192.168.1.24:123
21 Mar 20:25:37 ntpd[7895]: Listening on routing socket on fd #19 for interface updates
root@kmxbilr2 /etc/default #
Find all posts by this user
Quote this message in a reply
22nd Mar, 2018, 11:57 PM
Post: #13
Dzintars Bergs
Unregistered
 
RE: NTP doesn't work
stop dosen't work for me
Terminal
root@pi2 ~ # stop ntp
stop: Unknown instance:

I tried with init.d, bet after that upstart log was empty
Terminal
root@pi2 ~ # /etc/init.d/ntp stop
[ ok ] Stopping NTP server: ntpd.
root@pi2 ~ # rm -f /var/log/upstart/ntp.log
root@pi2 ~ # /etc/init.d/ntp start
[ ok ] Starting NTP server: ntpd.
root@pi2 ~ # cat /var/log/upstart/ntp.log
cat: /var/log/upstart/ntp.log: No such file or directory

After reboot upstart log looked like this
Terminal
root@pi2 ~ # cat /var/log/upstart/ntp.log
22 Mar 15:50:16 ntpd[3311]: ntpd 4.2.8p10@1.3728-o Sun Feb 25 22:00:44 UTC 2018 (1): Starting
22 Mar 15:50:16 ntpd[3311]: Command line: /usr/sbin/ntpd -n -g -L -U 1 -u 109:112 -c /var/lib/ntp/ntp.conf.dhcp
22 Mar 15:50:16 ntpd[3311]: proto: precision = 1.823 usec (-19)
22 Mar 15:50:16 ntpd[3311]: restrict: ignoring line 36, mask '::' unusable.
22 Mar 15:50:16 ntpd[3311]: unable to bind to wildcard address 0.0.0.0 - another process may be running - EXITING
Quote this message in a reply
23rd Mar, 2018, 07:44 PM
Post: #14
Skywatch Offline
Registered
Posts: 1,018
Joined: Mar 2013
Reputation: 28
RE: NTP doesn't work
Sorry to jump in here, but those last 2 lines in your upstart log I have seen here too.....It started about 2 months ago and I get an email every night with 2 lines like this.....

Terminal

22 Mar 00:09:02 ntpd[12642]: restrict: ignoring line 37, mask '::' unusable.
22 Mar 00:09:02 ntpd[12642]: unable to bind to wildcard address 0.0.0.0 - another process may be running - EXITING

Happens on all Xbian pi using RTC and updating via the NTP servers nightly.

I noticed that the "....mask '::'" bit is also in Nachteules log, but not the failed binding, so maybe a clue here? Huh
Find all posts by this user
Quote this message in a reply
29th Apr, 2018, 01:52 AM
Post: #15
Skywatch Offline
Registered
Posts: 1,018
Joined: Mar 2013
Reputation: 28
RE: NTP doesn't work
Hmmmm.....This is what I get after running @nachteules' commands...

Terminal

xbian@cinema2film ~ $ sudo stop ntp
ntp stop/waiting
xbian@cinema2film ~ $ sudo rm -f /var/log/upstart/ntp.log
xbian@cinema2film ~ $ sudo start ntp
ntp start/running, process 10128
xbian@cinema2film ~ $ sudo cat /var/log/upstart/ntp.log
28 Apr 16:51:06 ntpd[10128]: ntpd 4.2.8p10@1.3728-o Sun Feb 25 22:00:44 UTC 2018 (1): Starting
28 Apr 16:51:06 ntpd[10128]: Command line: /usr/sbin/ntpd -n -g -L -U 1 -u 109:112
28 Apr 16:51:06 ntpd[10128]: proto: precision = 1.198 usec (-20)
28 Apr 16:51:06 ntpd[10128]: restrict: ignoring line 37, mask '::' unusable.
28 Apr 16:51:06 ntpd[10128]: Listen and drop on 0 v4wildcard 0.0.0.0:123
28 Apr 16:51:06 ntpd[10128]: Listen normally on 1 lo 127.0.0.1:123
28 Apr 16:51:06 ntpd[10128]: Listen normally on 2 eth0 192.168.1.12:123
28 Apr 16:51:06 ntpd[10128]: Listening on routing socket on fd #19 for interface updates
28 Apr 16:51:07 ntpd[10128]: Soliciting pool server 129.70.132.37
28 Apr 16:51:08 ntpd[10128]: Soliciting pool server 144.76.102.204
28 Apr 16:51:09 ntpd[10128]: Soliciting pool server 176.9.42.71
28 Apr 16:51:09 ntpd[10128]: Soliciting pool server 185.233.106.45
28 Apr 16:51:10 ntpd[10128]: Soliciting pool server 131.234.137.63
28 Apr 16:51:10 ntpd[10128]: Soliciting pool server 173.249.29.54
28 Apr 16:51:10 ntpd[10128]: Soliciting pool server 212.83.44.18
28 Apr 16:51:11 ntpd[10128]: Soliciting pool server 145.239.0.195
28 Apr 16:51:11 ntpd[10128]: Soliciting pool server 46.4.88.180
28 Apr 16:51:11 ntpd[10128]: Soliciting pool server 80.153.195.191
28 Apr 16:51:12 ntpd[10128]: Soliciting pool server 129.70.132.32
28 Apr 16:51:12 ntpd[10128]: Soliciting pool server 5.199.135.170
xbian@cinema2film ~ $
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 17th May, 2025, 05:09 PM Powered By MyBB, © 2002-2025 MyBB Group.