mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 13:39:15 +03:00
Remove "wants" dependencies on <interface>.service
Instead it's enough to depend on sys-subsystem-net-devices-<interface>.device, which in turn has a "wants" dependency on the service (if any) that creates the interface.
This commit is contained in:
parent
d7458b5fc2
commit
bd1071d02b
2 changed files with 4 additions and 6 deletions
|
@ -24,7 +24,7 @@ let virtualbox = config.boot.kernelPackages.virtualbox; in
|
||||||
requires = [ "dev-vboxnetctl.device" ];
|
requires = [ "dev-vboxnetctl.device" ];
|
||||||
after = [ "dev-vboxnetctl.device" ];
|
after = [ "dev-vboxnetctl.device" ];
|
||||||
before = [ "network-interfaces.service" ];
|
before = [ "network-interfaces.service" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "network.target" "sys-subsystem-net-devices-vboxnet0.device" ];
|
||||||
path = [ virtualbox ];
|
path = [ virtualbox ];
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
|
|
|
@ -287,9 +287,8 @@ in
|
||||||
configureInterface = i: nameValuePair "${i.name}-cfg"
|
configureInterface = i: nameValuePair "${i.name}-cfg"
|
||||||
{ description = "Configuration of ${i.name}";
|
{ description = "Configuration of ${i.name}";
|
||||||
wantedBy = [ "network.target" ];
|
wantedBy = [ "network.target" ];
|
||||||
wants = [ "${i.name}.service" ];
|
|
||||||
bindsTo = [ "sys-subsystem-net-devices-${i.name}.device" ];
|
bindsTo = [ "sys-subsystem-net-devices-${i.name}.device" ];
|
||||||
after = [ "${i.name}.service" "sys-subsystem-net-devices-${i.name}.device" ];
|
after = [ "sys-subsystem-net-devices-${i.name}.device" ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
serviceConfig.RemainAfterExit = true;
|
serviceConfig.RemainAfterExit = true;
|
||||||
path = [ pkgs.iproute ];
|
path = [ pkgs.iproute ];
|
||||||
|
@ -323,7 +322,7 @@ in
|
||||||
|
|
||||||
createTunDevice = i: nameValuePair "${i.name}"
|
createTunDevice = i: nameValuePair "${i.name}"
|
||||||
{ description = "Virtual Network Interface ${i.name}";
|
{ description = "Virtual Network Interface ${i.name}";
|
||||||
wantedBy = [ "network.target" ];
|
wantedBy = [ "network.target" "sys-subsystem-net-devices-${i.name}.device" ];
|
||||||
serviceConfig =
|
serviceConfig =
|
||||||
{ Type = "oneshot";
|
{ Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
|
@ -337,8 +336,7 @@ in
|
||||||
deps = map (i: "sys-subsystem-net-devices-${i}.device") v.interfaces;
|
deps = map (i: "sys-subsystem-net-devices-${i}.device") v.interfaces;
|
||||||
in
|
in
|
||||||
{ description = "Bridge Interface ${n}";
|
{ description = "Bridge Interface ${n}";
|
||||||
wantedBy = [ "network.target" ];
|
wantedBy = [ "network.target" "sys-subsystem-net-devices-${n}.device" ];
|
||||||
wants = map (i: "${i}.service") v.interfaces;
|
|
||||||
bindsTo = deps;
|
bindsTo = deps;
|
||||||
after = deps;
|
after = deps;
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue