From 006f328877d12837a7129459925156c1f8e1e41e Mon Sep 17 00:00:00 2001 From: Mathijs Kwik Date: Fri, 19 Apr 2013 22:32:48 +0200 Subject: [PATCH] virtual network interfaces: make systemd aware of the relation between device and service If I want to bring down tap0.service (or systemd wants to do this during a configuration-change which changes the path to tunctl), openvpn (or other services using tap0) need to be brought down as well, otherwise tunctl -d is not able to remove the tap0 device, leaving it in a failed (but "up") state. --- modules/tasks/network-interfaces.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/tasks/network-interfaces.nix b/modules/tasks/network-interfaces.nix index 7738be28b42..cb0d17459ff 100644 --- a/modules/tasks/network-interfaces.nix +++ b/modules/tasks/network-interfaces.nix @@ -371,7 +371,8 @@ in { description = "Virtual Network Interface ${i.name}"; requires = [ "dev-net-tun.device" ]; after = [ "dev-net-tun.device" ]; - wantedBy = [ "network.target" "sys-subsystem-net-devices-${i.name}.device" ]; + wantedBy = [ "network.target" ]; + requiredBy = [ "sys-subsystem-net-devices-${i.name}.device" ]; serviceConfig = { Type = "oneshot"; RemainAfterExit = true;