You are not logged in.
So, I'm running a quasi permanent OpenVPN client connection on one of my systems, and I have a few services that are dependent on that VPN connection being there. That is: I want them to be running while the VPN connection is active and I want them to quit as soon as the connection drops for whatever reason.
It used to be that I could use BindsTo=sys-devices-virtual-net-tun0.device in the unit file of a service, and the service would start and stop depending on whether or not the VPN was active.
Now I just discovered that this is no longer the case, and upon investigation, I noticed that the systemd device sys-devices-virtual-net-tun0.device remains active, even after the openvpn process quits, and even though no tun0 device exists anymore.
Example:
# systemctl stop openvpn-client@myconfig
# ifconfig tun0 # to check if the device is really gone
tun0: error fetching interface information: Device not found
# systemctl status sys-devices-virtual-net-tun0.device
● sys-devices-virtual-net-tun0.device - /sys/devices/virtual/net/tun0
Loaded: loaded
Active: active (plugged) since Tue 2017-08-15 00:02:19 CEST; 2min 50s ago
Device: /sys/devices/virtual/net/tun0
Aug 15 00:02:19 myhost systemd[1]: Found device /sys/devices/virtual/net/tun0.
Any ideas?
Offline