shortening waiting time for ntpdate on bootup

Bug #39113 reported by Alexander Oltu
4
Affects Status Importance Assigned to Milestone
ntp (Ubuntu)
Fix Released
Medium
Scott James Remnant (Canonical)

Bug Description

Dapper latest update (11/04/2006).
ntpdate 4.2.0a+stable-8.1ubuntu3

If interface
is not lo
AND
is configured as auto in /etc/network/interfaces
AND
internet connection absent
system boot up takes long time, waiting until ntpdate lookups time host.

To reproduce problem:
1. Comment DNS servers in /etc/resolv.conf or comment gateway from configuration.
2. Stop networking /etc/init.d/networking stop or by ifdown command.
3. Reboot system or just stop-start networking by /etc/init.d/networking or ifdown ifup commands.

You will wait long time until network interface will be configured.

I suggest to put ntpdate process in background or using mechanism for checking if internet is available.

Like this if enough availability of DNS server:

--- ntpdate 2006-02-08 19:44:00.000000000 +0200
+++ ntpdate.new 2006-04-11 12:59:12.000000000 +0300
@@ -13,5 +13,8 @@
        NTPSERVERS="ntp.ubuntu.com"
 fi

+/bin/ping -q -c1 -W1 \
+ `/bin/grep -m1 "^nameserver" /etc/resolv.conf| /usr/bin/awk '{print $2}'` > /dev/null 2>&1 || exit 0
+
 [ "$VERBOSITY" = 1 ] && echo "Synchronizing clock to $NTPSERVERS..."
 /usr/sbin/ntpdate -b -s $NTPOPTIONS $NTPSERVERS || true

As for me is enough DNS server availability.
But in general I think we need to check $NTPSERVERS. Something like this:

/bin/ping -q -c1 -W3 $NTPSERVERS > /dev/null 2>&1 || exit 0

I putted 3 second here for TTL.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

ntpdate is run from an ifup script in dapper., which means nothing is waiting for it.

You may find that you are also experiencing bug #38787 which is why it's waiting at "Configuring network interfaces" rather than carrying on

Changed in ntp:
status: Unconfirmed → Fix Released
Revision history for this message
Alexander Oltu (sazs) wrote :

This is not a bug #38787.
Why you a so sure that nothing is waiting ifup? Did you tried that steps to reproduce bug?

This is what I get without internet connection and default ntpdate:

# time sudo ifup eth2
Error : Temporary failure in name resolution

real 1m20.137s
user 0m0.017s
sys 0m0.025s

Please change bug status.

Alexander Oltu (sazs)
Changed in ntp:
status: Fix Released → Unconfirmed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

This was a duplicate of bug 38787; in dapper the interface is brought up in the background and doesn't wait for ntpdate; the only reason you'd see a delay is because of 38787 which has now been fixed.

Changed in ntp:
assignee: nobody → keybuk
status: Unconfirmed → Fix Released
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Note that it is DELIBERATE that ifup takes a long time if run manually.

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.