Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
make a service systemd unit follow the interface state
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Anton Gubarkov
n00b
n00b


Joined: 13 Mar 2008
Posts: 66

PostPosted: Sun Feb 09, 2025 1:07 pm    Post subject: make a service systemd unit follow the interface state Reply with quote

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...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum