Confusing comments in /etc/default/ntpdate

Bug #537451 reported by Hans-Peter
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Server papercuts
Won't Fix
Low
Dave Walker
ntp (Ubuntu)
Won't Fix
Wishlist
Unassigned

Bug Description

Binary package hint: ntpdate

Not sure, if this is a bug at all, but i see strange things. Fact is, system clock was totally wrong (about half an hour). Calling ntpdate with ntp.ubuntu.com as timeserver corrected the system time. I now started to explore. Thats what I've found: In if-up.d directory ntpdate-debian is called. This one uses /etc/default/ntpdate as a config file. In my configfile NTPDATE_USE_NTP_CONF was set
to 'yes'. But ntp has never been installed on my system (as far as i know) and so config files for ntp did not exist (such as /etc/ntp.conf). So no servers from ntp, NTPSERVERS=ntp.ubuntu.com from /etc/defaut/ntpdate not used --> no syncing time.
Workaround: Installed ntp and removed it. -> /etc/ntp.conf now exists -> ntpdate-debian syncs system time.

BTW: I'm on lucid
greetings!

ProblemType: Bug
Architecture: i386
Date: Thu Mar 11 16:55:15 2010
DistroRelease: Ubuntu 10.04
Package: ntpdate 1:4.2.4p8+dfsg-1ubuntu1 [modified: usr/sbin/ntpdate-debian]
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-16.25-generic
SourcePackage: ntp
Uname: Linux 2.6.32-16-generic i686

Revision history for this message
Hans-Peter (hanspeterg) wrote :
Revision history for this message
Mathias Gug (mathiaz) wrote :

ntpdate-debian uses /etc/default/ntpdate for its configuration file. /etc/default/ntpdate should have a list of ntp servers in it:

# Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
# so you only have to keep it in one place.
NTPDATE_USE_NTP_CONF=yes

# List of NTP servers to use (Separate multiple servers with spaces.)
# Not used if NTPDATE_USE_NTP_CONF is yes.
NTPSERVERS="ntp.ubuntu.com"

I'm not sure what your problem is. ntpdate-debian is run only *once* when the network interface is brought up. If the system has been running from some time and the time drifted ntpdate-debian won't fix the time in a continuous manner: this is what ntp is for.

To summarize: ntpdate-debian corrects the time once, ntp corrects the time continuously.

Changed in ntp (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Hans-Peter (hanspeterg) wrote :

Hi!
No problem with continous synchronisation! Problem was: /etc/default/ntpdate says NTPDATE_USE_NTP_CONF=yes.
But /etc/ntp.conf does not exist, because ntp is not installed. -> nptdate-debian fails. At least I think so, because my system time was not correct.

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 537451] Re: ntpdate-debian not syncing time

On Tue, Mar 16, 2010 at 06:02:53PM -0000, Hans-Peter wrote:
>
> No problem with continous synchronisation! Problem was: /etc/default/ntpdate says NTPDATE_USE_NTP_CONF=yes.
> But /etc/ntp.conf does not exist, because ntp is not installed. -> nptdate-debian fails.

ntddate-debian doesn't use /etc/ntp.conf. It uses the time servers listed in /etc/default/ntpdate.

> At least I think so, because my system time was not correct.

ntpdate-debian is run *only* when network interfaces are brought up and will
correct the time *once*. If the system time drifts afterwards nothing will
correct it. If the system ran for a long time with no network interface change
the time could drift a lot.

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Revision history for this message
Hans-Peter (hanspeterg) wrote : Re: ntpdate-debian not syncing time

I just read the code of ntpdate-debian and did some testing. It is just that I have misunderstood the comment in /etc/default/ntpdate.
It says "# Set to "yes" to take the server list from /etc/ntp.conf ....". I understand now, that this is just an option. If the file is not there, even if NTPDATE_USE_NTP_CONF is set to yes, ntpdate-debian is working. So please close this bug report.
I will have to find out what is messing up my system time.
best regards,
Hans-Peter

Revision history for this message
Mathias Gug (mathiaz) wrote :

You're right. The comments in /etc/default/ntpdate are confusing.

summary: - ntpdate-debian not syncing time
+ Confusing comments in /etc/default/ntpdate
Changed in ntp (Ubuntu):
importance: Low → Wishlist
status: Incomplete → Triaged
Thierry Carrez (ttx)
Changed in server-papercuts:
importance: Undecided → Low
milestone: none → maverick-alpha-3
status: New → Triaged
Dave Walker (davewalker)
Changed in server-papercuts:
assignee: nobody → Dave Walker (davewalker)
Thierry Carrez (ttx)
Changed in server-papercuts:
milestone: maverick-alpha-3 → maverick-beta
Revision history for this message
Mathias Gug (mathiaz) wrote :

Marking won't fix as the comment is good enough IMO.

Changed in server-papercuts:
status: Triaged → Won't Fix
Changed in ntp (Ubuntu):
status: Triaged → Won't Fix
Revision history for this message
Kevin (kevin-matson) wrote :

I respect the package maintainers decision to let this one slide but the comment in /etc/default/ntpdate is confusing. You shouldn't have to read the code to figure out that if /etc/ntp.conf doesn't exist that a different NTP server will be used. Thanks for the clarification via Launchpad.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.