Opened 8 years ago

Closed 6 years ago

#7423 closed defect (worksforme)

dnsmasq lan interface race condition at boot

Reported by: Bryce Allen <ballen@…> Owned by: developers
Priority: normal Milestone:
Component: base system Version: Backfire 10.03
Keywords: dnsmasq, race, boot Cc:


If the lan interface is not up when /etc/init.d/dnsmasq runs, it will not add the proper dhcp-range arguments and won't provide DHCP to lan clients.

We saw this happening when using a DHCP wan interface, which for some reason also delayed the lan interface. I also saw it happening after adding tons of debug statements to the startup scripts - anything that adds delay to the startup process could make the race more likely to happen.

This problem is not actually limited to dnsmasq - we had similar problems with wifidog, which will not start unless it can determine the IP of br-lan.

Note that for both wifidog and dnsmasq, if we restart the daemon after boot, once all the interfaces are up, they worked fine, so it's not an issue with our config.

This seems to be a fundamental problem with the current asynchronous boot system. There is no mechanism I can find to delay starting network daemons until all network interfaces are up, and many network daemons need to know the IP of the interface they're running on to function.

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by anonymous

I am also seeing this problem with a custom load balancing script i have when it starts up on boot. I have it set to start at 46 after the network service starts. The same conditions described above seem to pop up. It not only affects my load balancer but also the dhcp server for the local network as none of the clients can pull leases due to dnsmasq not adding lan dhcp range.

I can always start these services up afterwards just fine but they just wont run on boot. I've gotten around this bug by simply adding a sleep loop to my scripts to make them sleep for a sec or two so the boot up the proper order but would like to not have to edit some of the default startup scripts like dnsmasq.

comment:2 Changed 6 years ago by nbd

  • Resolution set to worksforme
  • Status changed from new to closed

should be fixed with netifd

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.