I have an Ubuntu 16.04 system acting as a wifi access point and router, including as a DHCP server (isc-dhcp-server). There is something slightly flaky with the USB wifi card, and occasionally it resets, appearing to the host machine as if it has disconnected and reconnected. When this happens, DHCP stops working until I manually do /etc/init.d/isc-dhcp-server restart.
The only log message from dhcpd is receive_packet failed on wlan4: Network is down. strace appears to show that the daemon is continuing to select, but doesn't see any new packets that come in, as if it is listening on a socket connected to the "old" instance of the interface.
The logs show many other services being restarted when the interface comes back up (ntpd, sshd, named, etc) but dhcpd is not restarted. What's the difference between them? Is there a way to arrange for dhcpd to be automatically restarted when the interface bounces?
1 Answer
I added a line to the wlan4 stanza of /etc/network/interfaces saying
up /etc/init.d/isc-dhcp-server restart || trueNot sure if this is the "right" way to accomplish this, but it seems to work. I tested it by unplugging and reconnecting the wifi card, and dhcpd was restarted.