Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 12517 - ntpdate not connecting to server in cfg file
Summary: ntpdate not connecting to server in cfg file
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-21 06:44 UTC by dan
Modified: 2002-12-31 18:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dan 2002-12-21 06:44:59 UTC
I set the server in /etc/conf.d/ntp, and run /etc/init.d/ntp start 
I get: 
* Running ntpdate... 
21 Dec 07:43:03 ntpdate[9847]: no server suitable for synchronization found 
 * Failed to run ntpdate 
Yet, if I manually run it to the same server it works.
Comment 1 SpanKY gentoo-dev 2002-12-21 16:40:45 UTC
do this: 
rm /etc/conf.d/ntpd 
emerge rsync 
emerge ntp 
etc-update 
/etc/init.d/ntp restart (or whatever, just start it up and see if it works) 
 
if it still doesnt work, post these 2 files: 
/etc/ntp.conf 
/etc/init.d/ntpd 
Comment 2 dan 2002-12-21 17:04:32 UTC
OK, it's still not working. 
 
 
 
#!/sbin/runscript 
# Copyright 1999-2002 Gentoo Technologies, Inc. 
# Distributed under the terms of the GNU General Public License v2          
# $Header: /home/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.rc,v 1.4 2002/12/18 13:25:21 
vapier Exp $ 
 
depend() { 
	need net 
} 
 
checkconfig() { 
	if [ ! -f /etc/ntp.conf ] ; then 
		eerror "Please create /etc/ntp.conf" 
		return 1 
	fi 
 
	return 0 
} 
 
start() { 
	checkconfig || return $? 
 
	NTPDATESERVERS=`egrep '^(server|peer)[[:space:]]*' /etc/ntp.conf | awk '{print $2}'` 
	if [ -n "${NTPDATESERVERS}" ] ; then 
		ebegin "Running ntpdate" 
		ntpdate -b ${NTPDATESERVERS} > /dev/null 
		eend $? "Failed to run ntpdate" 
	else 
		ewarn "Please set a valid server line in /etc/ntp.conf" 
	fi 
 
	ebegin "Starting ntpd" 
	start-stop-daemon --start --quiet --pidfile /var/run/ntpd.pid \ 
		--startas /usr/bin/ntpd -- -p /var/run/ntpd.pid 
	eend $? "Failed to start ntpd" 
} 
 
stop() { 
	ebegin "Stopping ntpd" 
	start-stop-daemon --stop --quiet --pidfile /var/run/ntpd.pid 
	eend $? "Failed to stop ntpd" 
 
	# clean stale pidfile 
	[ -f /var/run/ntpd.pid ] && rm -f /var/run/ntpd.pid 
} 
 
======================================== 
AND 
======================================== 
 
# Config file for /etc/init.d/ntpd 
 
 
# Name of the server ntpd should sync with 
 
NTPDATESERVER=ntp.quidnet.com 
 
## 
# A list of available servers is available here: 
# * http://www.eecis.udel.edu/~mills/ntp/clock1.htm 
# and 
# * http://www.eecis.udel.edu/~mills/ntp/clock2.htm 
## 
Comment 3 SpanKY gentoo-dev 2002-12-21 18:40:08 UTC
re-read comment #1 and do what it says
Comment 4 dan 2002-12-23 07:26:06 UTC
Ok, I have followed the steps exactly. (i forgot to remove /etc/conf.d/ntpd) 
Now, the /etc/init.d/ntpd has not changed. 
and there is no longer any /etc/conf.d/ntpd. 
It still gives the same error. 
Comment 5 SpanKY gentoo-dev 2002-12-23 11:05:59 UTC
i asked you to post your /etc/ntp.conf
you havent :p
Comment 6 Christopher Rude 2002-12-27 10:52:25 UTC
I too am experiencing strange behaviour. I am using ntp-4.1.1b-r1.  I set my servers in /etc/ntpd.conf. run /etc/init.d/ntpd stop then /etc/init.d/ntpd start. No errors... and clock gets corrected ;~)  but then I reboot...... when the ntp service come up I get the same ntpdate falure. So I  rm /etc/conf.d/ntpd  /etc/init.d/ntpd stop  /etc/init.d/ntpd start.   Still go the ntpdate falure. So I took another look at the /etc/ntp.conf... well my 3 servers had ben replaced by 127.0.0.1. I looked at the ntp.conf.sv, and It was the config that I created. so I   cp /etc/ntp.conf.sv /etc/ntp.conf /etc/init.d/ntpd stop /etc/init.d/ntpd start  Once again ntp loads and corrects the clock.... then I reboot as this is what broke it before. I got the same ntpdate error.  /etc/init.d/ntpd stop /etc/init.d/ntpd start  same problem. So I looked at the /etc/ntp.conf and it had reverted to the 127.0.0.1 server again, checked the /etc/ntp.cong.sv and it was correct so I   cp /etc/ntp.conf.sv /etc/ntp.conf /etc/init.d/ntpd stop /etc/init.d/ntpd start  Once again working... So I reboot again....... same problem. I did not re emerge ntp... going to do that now just for kicks. BTW  /etc/init.d/ntpd:  #!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2          # $Header: /home/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.rc,v 1.4 2002/12/18 13:25:21 vapier Exp $  depend() { 	need net }  checkconfig() { 	if [ ! -f /etc/ntp.conf ] ; then 		eerror "Please create /etc/ntp.conf" 		return 1 	fi  	return 0 }  start() { 	checkconfig || return $?  	NTPDATESERVERS=`egrep '^(server|peer)[[:space:]]*' /etc/ntp.conf | awk '{print $2}'` 	if [ -n "${NTPDATESERVERS}" ] ; then 		ebegin "Running ntpdate" 		ntpdate -b ${NTPDATESERVERS} > /dev/null 		eend $? "Failed to run ntpdate" 	else 		ewarn "Please set a valid server line in /etc/ntp.conf" 	fi  	ebegin "Starting ntpd" 	start-stop-daemon --start --quiet --pidfile /var/run/ntpd.pid \ 		--startas /usr/bin/ntpd -- -p /var/run/ntpd.pid 	eend $? "Failed to start ntpd" }  stop() { 	ebegin "Stopping ntpd" 	start-stop-daemon --stop --quiet --pidfile /var/run/ntpd.pid 	eend $? "Failed to stop ntpd"  	# clean stale pidfile 	[ -f /var/run/ntpd.pid ] && rm -f /var/run/ntpd.pid }  and /etc/ntp.conf (w/my servers):  restrict default noquery notrust nomodify restrict 127.0.0.1 restrict 192.168.0.0 mask 255.255.255.0 fudge 127.127.1.0 stratum 3 server ntp-0.cso.uiuc.edu server ntp-1.cso.uiuc.edu server ntp-2.cso.uiuc.edu driftfile /etc/ntp.drift logfile /var/log/ntp.log  after reboot /etc/ntp.conf: restrict default noquery notrust nomodify restrict 127.0.0.1 restrict 192.168.0.0 mask 255.255.255.0 fudge 127.127.1.0 stratum 3 server 127.0.0.1 driftfile /etc/ntp.drift logfile /var/log/ntp.log  I hope this is of some value 
Comment 7 Christopher Rude 2002-12-27 11:12:45 UTC
I appologize about my post not wrapping.... but I dont know how to make it wrap  just an update the ntp.conf after reboot  hsas the server as 127.127.1.0 not 127.0.0.1 sorry about the mis type.. I also reemerged ntp.. but same problems as before. I did notice a different /etc/init.d/ntpd.. so here it is as well  #!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2          # $Header: /home/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.rc,v 1.6 2002/12/23 17:12:48 vapier Exp $  depend() { 	need net }  checkconfig() { 	if [ ! -f /etc/ntp.conf ] ; then 		eerror "Please create /etc/ntp.conf" 		return 1 	fi  	return 0 }  start() { 	checkconfig || return $?  	NTPDATESERVERS=`egrep '^(server|peer)[[:space:]]+' /etc/ntp.conf | awk '{print $2}'` 	if [ -n "${NTPDATESERVERS}" ] ; then 		ebegin "Running ntpdate" 		ntpdate -b ${NTPDATESERVERS} > /dev/null 		eend $? "Failed to run ntpdate" 	else 		ewarn "Please set a valid server line in /etc/ntp.conf" 	fi  	ebegin "Starting ntpd" 	start-stop-daemon --start --quiet --pidfile /var/run/ntpd.pid \ 		--startas /usr/bin/ntpd -- -p /var/run/ntpd.pid 	eend $? "Failed to start ntpd" }  stop() { 	ebegin "Stopping ntpd" 	start-stop-daemon --stop --quiet --pidfile /var/run/ntpd.pid 	eend $? "Failed to stop ntpd"  	# clean stale pidfile 	[ -f /var/run/ntpd.pid ] && rm -f /var/run/ntpd.pid 
Comment 8 Christopher Rude 2002-12-27 11:20:43 UTC
I appologize about my post not wrapping.... 

but I dont know how to make it wrap  just an update the ntp.conf after reboot 
hsas the server as 127.127.1.0 not 127.0.0.1 sorry about the mis typo.. 
I also reemerged ntp.. but same problems as before. 

I did notice a different /etc/init.d/ntpd.. so here it is as well  

#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2         
# $Header: /home/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.rc,v 1.6 2002/12/23
17:12:48 vapier Exp $

depend() {
	need net
}

checkconfig() {
	if [ ! -f /etc/ntp.conf ] ; then
		eerror "Please create /etc/ntp.conf"
		return 1
	fi

	return 0
}

start() {
	checkconfig || return $?

	NTPDATESERVERS=`egrep '^(server|peer)[[:space:]]+' /etc/ntp.conf | awk '{print
$2}'`
	if [ -n "${NTPDATESERVERS}" ] ; then
		ebegin "Running ntpdate"
		ntpdate -b ${NTPDATESERVERS} > /dev/null
		eend $? "Failed to run ntpdate"
	else
		ewarn "Please set a valid server line in /etc/ntp.conf"
	fi

	ebegin "Starting ntpd"
	start-stop-daemon --start --quiet --pidfile /var/run/ntpd.pid \
		--startas /usr/bin/ntpd -- -p /var/run/ntpd.pid
	eend $? "Failed to start ntpd"
}

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

	# clean stale pidfile
	[ -f /var/run/ntpd.pid ] && rm -f /var/run/ntpd.pid
}
Comment 9 Christopher Rude 2002-12-27 11:25:34 UTC
comment 7 and 8 are the same..... I was using knoquror, but switched to
mozilla.. now posts wrapp.. sorry about the repost. at least it is readable
now... I will shut up now unless I have something of value to add ;~>
Comment 10 SpanKY gentoo-dev 2002-12-27 13:19:15 UTC
why dont you post it as an attachment, *not* in the comment field 
Comment 11 SpanKY gentoo-dev 2002-12-31 18:47:27 UTC
the next version will render this invalid ...
see Bug 897 for more info