LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 09-02-2013, 11:35 PM   #1
Stannley
Member
 
Registered: Jul 2010
Posts: 35

Rep: Reputation: 0
ntpd dead but pid file exists


Hi Guys

As the subject says, my ntp daemon keeps failing.

/var/log/messages:
Code:
Sep  3 11:02:47 spvx10599 ntpd[28882]: ntpd 4.2.4p8@1.1612-o Thu Jan 10 15:17:40 UTC 2013 (1)
Sep  3 11:02:47 spvx10599 ntpd[28883]: precision = 0.097 usec
Sep  3 11:02:47 spvx10599 ntpd[28883]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Sep  3 11:02:47 spvx10599 ntpd[28883]: Listening on interface #1 wildcard, ::#123 Disabled
Sep  3 11:02:47 spvx10599 ntpd[28883]: Listening on interface #2 lo, ::1#123 Enabled
Sep  3 11:02:47 spvx10599 ntpd[28883]: Listening on interface #3 eth0, fe80::250:56ff:fe83:1#123 Enabled
Sep  3 11:02:47 spvx10599 ntpd[28883]: Listening on interface #4 lo, 127.0.0.1#123 Enabled
Sep  3 11:02:47 spvx10599 ntpd[28883]: Listening on interface #5 eth0, 10.0.1.108#123 Enabled
Sep  3 11:02:47 spvx10599 ntpd[28883]: Listening on routing socket on fd #22 for interface updates
Sep  3 11:02:47 spvx10599 ntpd[28883]: kernel time sync status 2040
Sep  3 11:02:47 spvx10599 ntpd[28883]: Cannot chdir() to `eth0': No such file or directory
It seems to have a problem with eth0.

[root@spvx10599 ntp]# ntpq -p
ntpq: read: Connection refused

I can ping the servers in the config file:
Code:
[root@spvx10599 ntp]# ping 172.18.0.1
PING 172.18.0.1 (172.18.0.1) 56(84) bytes of data.
64 bytes from 172.18.0.1: icmp_seq=1 ttl=251 time=41.8 ms
64 bytes from 172.18.0.1: icmp_seq=2 ttl=251 time=41.8 ms
64 bytes from 172.18.0.1: icmp_seq=3 ttl=251 time=41.8 ms
^C
--- 172.18.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2561ms
rtt min/avg/max/mdev = 41.822/41.866/41.890/0.238 ms
[root@spvx10599 ntp]# ping 172.18.0.2
PING 172.18.0.2 (172.18.0.2) 56(84) bytes of data.
64 bytes from 172.18.0.2: icmp_seq=1 ttl=250 time=44.8 ms
64 bytes from 172.18.0.2: icmp_seq=2 ttl=250 time=44.0 ms
64 bytes from 172.18.0.2: icmp_seq=3 ttl=250 time=44.7 ms
^C
--- 172.18.0.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2264ms
rtt min/avg/max/mdev = 44.052/44.548/44.837/0.428 ms
[root@spvx10599 ntp]# ping 172.19.0.2
PING 172.19.0.2 (172.19.0.2) 56(84) bytes of data.
64 bytes from 172.19.0.2: icmp_seq=1 ttl=250 time=45.6 ms
64 bytes from 172.19.0.2: icmp_seq=2 ttl=250 time=45.6 ms
^C
--- 172.19.0.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1905ms
rtt min/avg/max/mdev = 45.631/45.657/45.683/0.026 ms
[root@spvx10599 ntp]# ping 172.19.0.1
PING 172.19.0.1 (172.19.0.1) 56(84) bytes of data.
64 bytes from 172.19.0.1: icmp_seq=1 ttl=251 time=44.2 ms
64 bytes from 172.19.0.1: icmp_seq=2 ttl=251 time=44.2 ms
64 bytes from 172.19.0.1: icmp_seq=3 ttl=251 time=44.2 ms
64 bytes from 172.19.0.1: icmp_seq=4 ttl=251 time=44.2 ms
^C
--- 172.19.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3236ms
rtt min/avg/max/mdev = 44.215/44.237/44.257/0.149 ms
I have the same setup on other machines and its working correctly. I have even copied the config file from a working install to this machine. Of course this is the production machine where its not working

I would be very grateful if anyone has any ideas on how to get this working.

We are using Red Hat 6.3.

Thanks

Simon
 
Old 09-03-2013, 05:21 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by Stannley View Post
Code:
Sep  3 11:02:47 spvx10599 ntpd[28883]: Cannot chdir() to `eth0': No such file or directory
I'd check for command line or configuration file errors first.
 
Old 09-05-2013, 01:57 AM   #3
Stannley
Member
 
Registered: Jul 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
I'd check for command line or configuration file errors first.
Hi unSpawn

I thought it might be the ntpd config which is why I copied the file (scp) from a server that was working and therefore (presumably) is set up correctly. Still no good.

If I could understand what it was trying to do then I might be better placed in figuring out whats going wrong. For example, what is the path its trying to reach when it reports the following:

Code:
Sep  3 11:02:47 spvx10599 ntpd[28883]: Cannot chdir() to `eth0': No such file or directory
Cheers

Simon
 
Old 09-05-2013, 02:43 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
/var/lib/ntp prolly.
 
Old 09-06-2013, 12:58 AM   #5
Stannley
Member
 
Registered: Jul 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
/var/lib/ntp prolly.
Hi unSpawn

I checked that location and the drift file did not exist. I tried copying one from a working server but it still did not work:

Code:
[root@spvx10599 ntp]# ls -lah
total 12K
drwxr-xr-x.  2 ntp  ntp  4.0K Sep  6 12:54 .
drwxr-xr-x. 53 root root 4.0K Nov 14  2012 ..
-rw-r--r--.  1 ntp  ntp     6 Sep  6 12:54 drift
[root@spvx10599 ntp]# service ntpd restart
Shutting down ntpd:                                        [FAILED]
Starting ntpd:                                             [  OK  ]
[root@spvx10599 ntp]# service ntpd status
ntpd dead but pid file exists
[root@spvx10599 ntp]# ls -lah
total 12K
drwxr-xr-x.  2 ntp  ntp  4.0K Sep  6 12:54 .
drwxr-xr-x. 53 root root 4.0K Nov 14  2012 ..
-rw-r--r--.  1 ntp  ntp     6 Sep  6 12:54 drift
 
Old 09-06-2013, 02:06 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
No that's not how you should do that. Post the complete command line for starting ntpd and its configuration file without comments (use 'grep -v "^#" /path/to/conffile|grep .;').
 
1 members found this post helpful.
Old 09-08-2013, 09:01 PM   #7
Stannley
Member
 
Registered: Jul 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
No that's not how you should do that. Post the complete command line for starting ntpd and its configuration file without comments (use 'grep -v "^#" /path/to/conffile|grep .;').
Hi unSpawn

I have fixed this issue now. I found that the /etc/sysconfig/ntpd config contained the following:

Code:
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g -x -i eth0"
Whereas all the other machines have this:

Code:
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"
I made the config look the same as the others, restarted ntpd and its now working.

Thanks for all your help.

Simon
 
Old 09-11-2013, 01:32 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Well done fixing that yourself!
 
  


Reply

Tags
ntp


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
dovecot dead but pid file exists rs232 Linux - Software 3 09-30-2010 06:25 AM
dead but pid file exists fahlen Linux - Software 1 12-18-2007 09:14 AM
exim dead but pid file exists File.am *BSD 2 03-22-2007 05:11 PM
ntpd dead but pid file exists wjn Linux - Networking 15 05-22-2005 01:32 PM
xinetd dead but pid file exists pas Linux - Newbie 2 01-21-2005 04:52 PM


All times are GMT -5. The time now is 03:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration