sown / tasks

Tasks for sown projects
0 stars 0 forks source link

Node DHCP server issues #40

Open TimStallard opened 4 years ago

TimStallard commented 4 years ago

Nodes regularly fail to give DHCP leases to connected clients. We've implemented a check that reads logs and checks for associated clients but no DHCP leases, but the underlying issue needs to be investigated.

This seems like some kind of race condition on tunnel restart between dnsmasq starting and the wireless interface coming up. Could investigate on a test node repeatedly restarting the tunnel.

TimStallard commented 4 years ago

I can reproduce this on a node here by restarting the tunnel. Something also appears to attempt to restart/HUP dnsmasq when the wireless interface is taken down and up again (which is why we restart it in the first place). Worth investigating what's doing that and if our manual restart is needed anymore.

TimStallard commented 4 years ago

Looking at this further, I think a big part of the issue is that openvpn drops privileges to nobody. There's a lot of the hook script that it can't run, which includes taking the wireless interface up/down, and we currently rely on the cron job to spot this.

Worth considering changing openvpn to run as root so it can run the hook scripts?

Would need changes on the node_control side.