netns: ensure that network.target depends on network-pre.target (why doesnt it by default?)

this should fix that servo tries to start wg-ovpns before the netns is configured
This commit is contained in:
Colin 2024-06-18 09:07:40 +00:00
parent bbf8fd5b20
commit f9091c0b0c

View File

@ -90,6 +90,8 @@ let
# ordered ambiguously w.r.t. network-local-commands (a dep of "network.target").
systemd.services.network-local-commands.wantedBy = [ "network-pre.target" ];
systemd.services.network-local-commands.before = [ "network-pre.target" ];
systemd.targets.network-pre.wantedBy = [ "network.target" ];
systemd.targets.network-pre.before = [ "network.target" ];
# create a new routing table that we can use to proxy traffic out of the root namespace
# through the wireguard namespaces, and to the WAN via VPN.
@ -115,6 +117,7 @@ in
networking.iproute2.rttablesExtraConfig = f.networking.iproute2.rttablesExtraConfig;
networking.iproute2.enable = f.networking.iproute2.enable;
systemd.services.network-local-commands = f.systemd.services.network-local-commands;
systemd.targets.network-pre = f.systemd.targets.network-pre;
};
in take (sane-lib.mkTypedMerge take configs);
}