Comment 1 for bug 1772941

Revision history for this message
Wladimir Mutel (mwg) wrote :

On my system (Ubuntu 18.04 configured with netplan.io and systemd-networkd where possible), dhcpd is configured by default, so it just enumerates currently-available IP subnets on interfaces to determine on which interface to listen.
The only interface it is normally listening on my system is br0, which currently includes only wlan0 interface managed by hostapd.
On one reboot I had a race condition between dhcpd and hostapd : on its startup, hostapd did 'country update' on wlan0 which temporarily brought it down, and br0 went down as well, then systemd-networkd temporarily removed its IP address. Right at this moment, dhcpd had begun to start, looking matching IPs on interfaces and failing to find any of them. After that I got working hostapd (WiFi network visible to clients), but clients unable to configure their IPs after WiFi authentication.

So, yes, 'sleep 30' can be a solution, but it is better to implement some dependency on the systemd level. Like, start dhcpd not earlier than hostapd is started and operating. Or maybe start hostapd not earlier than dhcpd has found its subnet and interface (if dhcpd is capable to survive through temporary drop-down of its interface during normal operation).