Modify

Opened 7 years ago

Closed 3 years ago

Last modified 2 years ago

#5301 closed defect (obsolete)

[ntpclient] has to wait for dnsmasq

Reported by: Malte S. Stretz <mss@…> Owned by: thepeople
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version: Kamikaze 8.09
Keywords: Cc:

Description

I ran into a timing error between dnsmasq and ntpclient on my RouterBoard 411. The board has only a single ethernet device, which is set up via DHCP as lan. When dnsmasq is installed, it wants to be the local caching resolver, but it is started before the network goes up/the device gets its IP address and its DNS server. So dnsmasq postpones reading of /tmp/resolv.conf.auto to a later time and the ntpclient can't resolve its servers and fails. It seems like only short delay is needed because resolving any address later on will make dnsmasq reload the resolv.conf.

A sleep 1 in ntpclient will probably fix this, but I guess the base system should trigger dnsmasq when the interface goes up.

Jun  1 09:21:06 OpenWrt daemon.info dnsmasq[632]: started, version 2.47 cachesize 150
Jun  1 09:21:06 OpenWrt daemon.info dnsmasq[632]: compile time options: IPv6 GNU-getopt no-DBus no-I18N TFTP
Jun  1 09:21:06 OpenWrt daemon.info dnsmasq[632]: using local addresses only for domain lan
Jun  1 09:21:06 OpenWrt daemon.warn dnsmasq[632]: no servers found in /tmp/resolv.conf.auto, will retry
Jun  1 09:21:06 OpenWrt daemon.info dnsmasq[632]: read /etc/hosts - 1 addresses
Jun  1 09:21:06 OpenWrt user.debug kernel: ar71xx-wdt: enabling watchdog timer
Jun  1 09:21:08 OpenWrt user.info sysinit: Sending select for 10.67.0.210...
Jun  1 09:21:09 OpenWrt user.info sysinit: Lease of 10.67.0.210 obtained, lease time 2592000
Jun  1 09:21:09 OpenWrt user.info sysinit: udhcpc: ifconfig eth0 10.67.0.210 netmask 255.255.255.0 broadcast 10.67.0.255
Jun  1 09:21:09 OpenWrt user.info sysinit: udhcpc: setting default routers: 10.67.0.1
Jun  1 09:21:09 OpenWrt user.info sysinit: udhcpc: setting dns servers: 10.67.0.1
Jun  1 09:21:09 OpenWrt user.notice root: adding lan (eth0) to firewall zone lan
Jun  1 09:21:09 OpenWrt user.info sysinit: 0.openwrt.pool.ntp.org: Unknown host
Jun  1 09:21:09 OpenWrt user.info sysinit: 1.openwrt.pool.ntp.org: Unknown host
Jun  1 09:21:09 OpenWrt user.info sysinit: 2.openwrt.pool.ntp.org: Unknown host
Jun  1 09:21:09 OpenWrt user.info sysinit: 3.openwrt.pool.ntp.org: Unknown host
Jun  1 09:21:10 OpenWrt daemon.info init: init: starting pid 212, tty '/dev/ttyS0': '/bin/ash --login'
Jun  1 09:21:14 OpenWrt user.debug kernel: eth0: no IPv6 routers present
Jun  1 09:45:24 OpenWrt authpriv.info dropbear[736]: Child connection from ::ffff:10.67.0.116:49613
Jun  1 09:45:25 OpenWrt authpriv.notice dropbear[736]: password auth succeeded for 'root' from ::ffff:10.67.0.116:49613
Jun  1 09:46:11 OpenWrt daemon.info dnsmasq[632]: reading /tmp/resolv.conf.auto
Jun  1 09:46:11 OpenWrt daemon.info dnsmasq[632]: using nameserver 10.67.0.1#53
Jun  1 09:46:11 OpenWrt daemon.info dnsmasq[632]: using local addresses only for domain lan
Jun  1 09:46:12 OpenWrt user.notice root: starting ntpclient

Attachments (1)

bug5301.patch (1.3 KB) - added by Malte S. Stretz <mss@…> 7 years ago.
A better solution: Make hotplug always wait one second for dnsmasq polling resolv.conf.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by Malte S. Stretz <mss@…>

This patch against the ntpclient hotplug script helps but I'm not sure its the correct approach:

--- 20-ntpclient.orig   Fri May 15 02:42:15 2009
+++ etc/hotplug.d/iface/20-ntpclient    Sun Jun  7 17:58:44 2009
@@ -16,6 +16,7 @@
        config_get hostname $1 hostname
        config_get port $1 port
        [ -z "$hostname" ] && return
+       sleep 1
        $NTPC -c 1 -p ${port:-123} -h $hostname > /dev/null && { SERVER=$hostname; PORT=${port:-123}; }
 }

Changed 7 years ago by Malte S. Stretz <mss@…>

A better solution: Make hotplug always wait one second for dnsmasq polling resolv.conf.

comment:2 Changed 7 years ago by Malte S. Stretz <mss@…>

See #5589 for a better solution.

comment:3 Changed 6 years ago by thepeople

  • Owner changed from developers to thepeople
  • Status changed from new to assigned

comment:4 Changed 3 years ago by nbd

  • Resolution set to obsolete
  • Status changed from assigned to closed

comment:5 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.