nixos: Fix ordering of firewall.service
Follow-up to the following commits:abdc5961c3: Fix starting the firewalle090701e2d: Order before sysinit Solely use sysinit.target here instead of multi-user.target because we want to make sure that the iptables rules are applied *before* any socket units are started. The reason I've dropped the wantedBy on multi-user.target is that sysinit.target is already a part of the dependency chain of multi-user.target. To make sure that this holds true, I've added a small test case to ensure that during switch of the configuration the firewall.service is considered as well. Tested using the firewall NixOS test. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @edolstra
This commit is contained in:
@@ -490,7 +490,7 @@ in
|
||||
|
||||
systemd.services.firewall = {
|
||||
description = "Firewall";
|
||||
wantedBy = [ "multi-user.target" "sysinit.target" ];
|
||||
wantedBy = [ "sysinit.target" ];
|
||||
wants = [ "network-pre.target" ];
|
||||
before = [ "network-pre.target" ];
|
||||
after = [ "systemd-modules-load.service" ];
|
||||
@@ -501,6 +501,7 @@ in
|
||||
# containers don't have CAP_SYS_MODULE. So the host system had
|
||||
# better have all necessary modules already loaded.
|
||||
unitConfig.ConditionCapability = "CAP_NET_ADMIN";
|
||||
unitConfig.DefaultDependencies = false;
|
||||
|
||||
reloadIfChanged = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user