Anton Gubarkov n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 13 Mar 2008 Posts: 66
|
Posted: Sun Feb 09, 2025 1:07 pm Post subject: make a service systemd unit follow the interface state |
|
|
Hi,
I have a rather stupid server that fails to resume its listening on the interface when the interface cycles down/up.
I have a unit for this server that WantedBy multi-user.target and everything works fine when this service is started while my notebook is connected online.
I want the service to stop when my zerotier interface goes down. It is pretty easy achieved by adding BindTo=sys-subsystem-net-devices-ztzlge64hc.device into the [Unit] section.
I also want the service to start every time the interface goes up. I can't figure out how to do it.
I tried After=sys-subsystem-net-devices-ztzlge64hc.device, WantedBy=sys-subsystem-net-devices-ztzlge64hc.device - to no avail...
there is a vague reference that I can use udev events to start the service, however I couldn't find any documentation about it. Anyway, I have a systemd device unit that follows the interface's state... |
|