0

I have setup on my desk, where Ethernet connected device is plugged into port of my USB-C docking station (same that powers the notebook). I've configured isc-dhcpd to work on enx3ce1a14ec0bd interface, what works... until it doesn't.

I disconnect my power supply overnight and put the machine to sleep (hibernation not configured yet). But that shuts down the docking station and as it's USB device the Ethernet port is disconnected from the system.

When I turn it on again in the morning, the port is back, but isc-dhcpd doesn't listen on enx3ce1a14ec0bd and the last message in the journal is (Polish locale):

sty 25 22:31:23 norah dhcpd[3578682]: receive_packet failed on enx3ce1a14ec0bd: Network is down 

I had to restart the daemon manually (systemctl restart) to get it working.

Now, the question is how to set up a isc-dhcpd restart (of fix the problem other way) when the USB Ethernet comes back to life?

3
  • Does adding Restart=on-failure as part of the [service] section of isc-dhcp-server.service help ? (Possibly adding a RestartSec=3 condition) Commented Jan 26, 2023 at 10:46
  • @MC68020 the systemctl status isc-dhcpd shows active (running) even after the interface error is reported, so it doesn't exit on that error. Commented Jan 26, 2023 at 10:57
  • You might to make the service BindsTo= and WantedBy= the device unit. (Or maybe a udev rule that restarts the service on the add action, if you prefer.) Commented Jan 26, 2023 at 14:23

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.