Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ntpd won't restart
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Valhlalla
Apprentice
Apprentice


Joined: 22 Sep 2003
Posts: 161
Location: Sydney, Australia.

PostPosted: Wed Feb 25, 2004 11:03 pm    Post subject: ntpd won't restart Reply with quote

I have ntpd setup and seems to be working ok, but I have a strange problem. If I stop the service

Code:

root@XXX#/etc/init.d/ntpd stop


it stops fine, but then when I got to start it again, this happens.

Code:

root@XXX#/etc/init.d/ntpd start
 * Starting ntpd...
 * Failed to start ntpd


Now if I reboot the box, its up and running again, and if i start ntpd with
Code:

/usr/bin/ntpd


it runs and gives no error.

Any ideas as to what is happening and/or how to fix it?
_________________
Pork Chop Sandwiches, Oh Sh*t!
Back to top
View user's profile Send private message
giannifive
n00b
n00b


Joined: 29 Jan 2004
Posts: 50
Location: Chicago, IL

PostPosted: Wed Feb 25, 2004 11:28 pm    Post subject: Reply with quote

Have you looked at your logs to see what the error might be? Try /var/log/everything/current (for metalog), /var/log/messages (for syslog or syslog-ng). Grep for ntpd.
Back to top
View user's profile Send private message
Valhlalla
Apprentice
Apprentice


Joined: 22 Sep 2003
Posts: 161
Location: Sydney, Australia.

PostPosted: Wed Feb 25, 2004 11:34 pm    Post subject: Reply with quote

Nothing that seems helpfull

from metalog:
Code:

Feb 26 09:48:35 [ntpd] ntpd 4.1.2@1.892 Tue Feb 24 15:23:35 EST 2004(1)
Feb 26 09:48:35 [ntpd] precision = 13 usec
Feb 26 09:48:35 [ntpd] kernel time discipline status 0040
Feb 26 09:57:24 [rc-scripts] Failed to start ntpd


and similar in /var/log/ntpd.log
Code:

26 Feb 09:48:35 ntpd[4086]: frequency initialized -164.949 from /var/lib/ntp/ntp.drift
26 Feb 09:48:35 ntpd[4087]: signal_no_reset: signal 17 had flags 4000000
26 Feb 09:53:06 ntpd[4086]: kernel time discipline status change 41
26 Feb 10:24:15 ntpd[4086]: time reset -0.319923 s
26 Feb 10:24:15 ntpd[4086]: synchronisation lost

_________________
Pork Chop Sandwiches, Oh Sh*t!
Back to top
View user's profile Send private message
lonewolfnight
n00b
n00b


Joined: 16 Feb 2004
Posts: 14
Location: St. Paul MN

PostPosted: Thu Feb 26, 2004 3:18 am    Post subject: Reply with quote

I'm experiencing the same issue right now.

ntp.conf

logfile /var/log/ntpd.log
driftfile /var/lib/ntp/ntp.drift
server nss.nts.umn.edu prefer
server ns.nts.umn.edu
restrict 127.0.0.1
restrict 10.0.0.0 mask 255.0.0.0
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10

/etc/conf.d/ntpd

NTPD_OPTS="-U ntp -g"

I'm not recieving any log output that is current. Seems something to do with the boot script.
Back to top
View user's profile Send private message
Valhlalla
Apprentice
Apprentice


Joined: 22 Sep 2003
Posts: 161
Location: Sydney, Australia.

PostPosted: Thu Feb 26, 2004 3:32 am    Post subject: Reply with quote

perhaps in the latest ebuild, has the rc script changed recently?

It still seems strange that it works fine if I reboot.
_________________
Pork Chop Sandwiches, Oh Sh*t!
Back to top
View user's profile Send private message
Valhlalla
Apprentice
Apprentice


Joined: 22 Sep 2003
Posts: 161
Location: Sydney, Australia.

PostPosted: Thu Feb 26, 2004 11:11 pm    Post subject: Reply with quote

*bump* anyone have a solution, or maby someone can post an older version of the ntpd start up script to check the differences.
_________________
Pork Chop Sandwiches, Oh Sh*t!
Back to top
View user's profile Send private message
simulacrum
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2002
Posts: 128
Location: St Paul, MN

PostPosted: Mon Mar 01, 2004 7:18 am    Post subject: Reply with quote

I just ran into the same error, and (luckily) had an easy fix. I've been playing around with my ntpd configuration and apparently left a pid file which prevented ntpd from starting.

rm /var/run/ntpd.pid

worked for me, hopefully this helps.
Back to top
View user's profile Send private message
Valhlalla
Apprentice
Apprentice


Joined: 22 Sep 2003
Posts: 161
Location: Sydney, Australia.

PostPosted: Tue Mar 02, 2004 12:38 am    Post subject: Reply with quote

Thank you simulacrum worked perfectley,
Any ideas as to why this pid file is hanging around, should't it be removed when the process is killed?
_________________
Pork Chop Sandwiches, Oh Sh*t!
Back to top
View user's profile Send private message
simulacrum
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2002
Posts: 128
Location: St Paul, MN

PostPosted: Wed Mar 03, 2004 4:17 am    Post subject: Reply with quote

I'm starting to believe it is a bug with ntpd. I restarted ntpd last night and noticed that the pid file was not removed when it shut down so I ran into this same problem again. Perhaps as a workaround the init script could be modified to remove it on shutdown.
Back to top
View user's profile Send private message
ferdam
n00b
n00b


Joined: 05 Jan 2004
Posts: 10
Location: Sao Paulo - Brazil

PostPosted: Wed Mar 03, 2004 5:17 pm    Post subject: Reply with quote

There is a bug in /etc/init.d/ntpd :

add this line :

...
stop() {
ebegin "Stopping ntpd"
start-stop-daemon --stop --quiet --pidfile /var/run/ntpd.pid
rm -f /var/run/ntpd.pid
eend $? "Failed to stop ntpd"
}

Regards,
Fernando
_________________
ferdam - Linux user #394173
Back to top
View user's profile Send private message
Valhlalla
Apprentice
Apprentice


Joined: 22 Sep 2003
Posts: 161
Location: Sydney, Australia.

PostPosted: Thu Mar 04, 2004 5:17 am    Post subject: Reply with quote

I used this, but I thought ntp should remove this file itself shouldnt it?

Code:

stop() {
ebegin "Stopping ntpd"
if [ -f /var/run/ntpd.pid ]; then
    rm -f /var/run/ntpd.pid;
fi
eend $? "Failed to stop ntpd"
}


_________________
Pork Chop Sandwiches, Oh Sh*t!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum