LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 10-17-2009, 11:27 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 623

Rep: Reputation: 33
NTP synchronisation not working


I have a server that needs to serve as timeserver.

On the timeserver :

Code:
bash-3.2# /usr/sbin/ntpdate 1.centos.pool.ntp.org
17 Oct 17:23:41 ntpdate[4040]: the NTP socket is in use, exiting

bash-3.2# /usr/sbin/ntptime
ntp_gettime() returns code 5 (ERROR)
  time ce845f88.f1aaa000  Sat, Oct 17 2009 17:21:44.944, (.944010),
  maximum error 16384000 us, estimated error 16384000 us
ntp_adjtime() returns code 5 (ERROR)
  modes 0x0 (),
  offset 0.000 us, frequency 0.000 ppm, interval 1 s,
  maximum error 16384000 us, estimated error 16384000 us,
  status 0x40 (UNSYNC),
  time constant 0, precision 1.000 us, tolerance 512 ppm,
On the server that needs to synchronize :

Code:
# ntpclient -h server_ip
40101 55200.082  rejected packet: LI==3
On the firewall of the timeserver UDP port 123 is open for incoming and outgoing NTP-traffic.
 
Old 10-17-2009, 12:20 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
This line looks wrong: "17 Oct 17:23:41 ntpdate[4040]: the NTP socket is in use, exiting". Is ntpd running?

EDIT: if ntpd is running, is the time correct (to within a second or two)? How is ntpd's health (what sort of messages is it posting the the /var/log/* files? What does /etc/ntp.conf look like?

Last edited by catkin; 10-17-2009 at 12:35 PM.
 
Old 10-17-2009, 12:31 PM   #3
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 623

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by catkin View Post
This line looks wrong: "17 Oct 17:23:41 ntpdate[4040]: the NTP socket is in use, exiting". Is ntpd running?
Code:
bash-3.2# /sbin/service ntpd status
ntpd (pid 3646) is running...
 
Old 10-17-2009, 12:38 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Quote:
Originally Posted by jonaskellens View Post
Code:
bash-3.2# /sbin/service ntpd status
ntpd (pid 3646) is running...
I think that is enough to explain the error message. Assuming this might be the case I EDITted my last post, asking a few more questions ...
 
Old 10-19-2009, 02:41 AM   #5
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 623

Original Poster
Rep: Reputation: 33
/var/log/messages :

Code:
bash-3.2# less messages | grep ntp
bash-3.2#
/etc/ntp.conf :

Code:
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1 
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org

#broadcast 192.168.1.255 key 42         # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 key 42             # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 key 42  # manycast client

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. 
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
no clients are restricted...
 
Old 10-29-2009, 07:02 AM   #6
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 623

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by catkin View Post
if ntpd is running, is the time correct (to within a second or two)?
Time is correct.
Quote:
Originally Posted by catkin View Post
How is ntpd's health (what sort of messages is it posting the the /var/log/* files? What does /etc/ntp.conf look like?
I find nothing in the /var/log/messages-file or any other file.
/etc/ntp.conf :
Code:
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
#restrict default kod nomodify notrap nopeer noquery
restrict default kod nomodify notrap nopeer
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1 
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org

#broadcast 192.168.1.255 key 42         # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 key 42             # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 key 42  # manycast client

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. 
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
I have no restrictions on my time-server for ntp-clients and the timeserver itself should equalize with the centos-pool.
 
Old 10-29-2009, 07:32 AM   #7
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291
Hello,

Not sure if this is of use to you but when ntpd is running you cannot execute a ntpdate. I just tried it to confirm what I was thinking:
Code:
srvlb1:~# /etc/init.d/ntp status
NTP server is running..
srvlb1:~# ntpdate  193.204.114.105
29 Oct 12:28:44 ntpdate[4559]: the NTP socket is in use, exiting
srvlb1:~# /etc/init.d/ntp stop
Stopping NTP server: ntpd.
srvlb1:~# ntpdate 81.19.96.148
29 Oct 12:29:56 ntpdate[4594]: adjust time server 81.19.96.148 offset -0.000579 sec
srvlb1:~# /etc/init.d/ntp start
Starting NTP server: ntpd.
My servers all synchronize correctly but when I need to do a manual synchronization I have to stop the ntp daemon.

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 08:35 PM
ntp server is not working on RHEL5 - any help? samengr Linux - Server 1 04-14-2009 10:16 AM
ntp server on Fedora 8 not working Tom Douglas Linux - Server 2 03-08-2008 07:27 PM
ntp -- is it working? synaptical Linux - Software 4 08-23-2004 04:50 PM
Network Time Protocol (NTP): Are you sure it's working? mchirico LinuxQuestions.org Member Success Stories 0 06-12-2004 07:00 PM


All times are GMT -5. The time now is 08:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration