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.
This commit is contained in:
Mathijs Kwik 2013-04-19 22:32:48 +02:00
parent 8de00c328a
commit 006f328877
1 changed files with 2 additions and 1 deletions

View File

@ -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;