This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Service key "expose" functionality is flaky on big changes #109
Labels
bug
Something isn't working
Comments
1e47b47 - build: disable `DynamicUser` and temporary key access
Signed-off-by: Roman Volosatovs <[email protected]>
(G) Roman Volosatovs <[email protected]> (Tue Aug 9 14:06:17 2022 +0200)
diff --git a/nixosConfigurations/services/benefice.nix b/nixosConfigurations/services/benefice.nix
index 8a90bc7..9098a69 100644
--- a/nixosConfigurations/services/benefice.nix
+++ b/nixosConfigurations/services/benefice.nix
@@ -31,7 +31,8 @@ with flake-utils.lib.system; let
sops.secrets.oidc-secret.restartUnits = ["benefice.service"];
sops.secrets.oidc-secret.sopsFile = "${self}/hosts/${config.networking.fqdn}/oidc-secret";
- systemd.services.benefice = self.lib.systemd.withSecret config pkgs "benefice" "oidc-secret";
+ #systemd.services.benefice = self.lib.systemd.withSecret config pkgs "benefice" "oidc-secret";
+ systemd.services.benefice.serviceConfig.DynamicUser = pkgs.lib.mkForce false;
})
];
diff --git a/nixosConfigurations/services/steward.nix b/nixosConfigurations/services/steward.nix
index 7262a33..1ae780c 100644
--- a/nixosConfigurations/services/steward.nix
+++ b/nixosConfigurations/services/steward.nix
@@ -22,7 +22,8 @@ with flake-utils.lib.system; let
sops.secrets.key.restartUnits = ["steward.service"];
sops.secrets.key.sopsFile = "${self}/hosts/${config.networking.fqdn}/steward.key";
- systemd.services.steward = self.lib.systemd.withSecret config pkgs "steward" "key";
+ #systemd.services.steward = self.lib.systemd.withSecret config pkgs "steward" "key";
+ systemd.services.steward.serviceConfig.DynamicUser = pkgs.lib.mkForce false;
})
]; This is the patch to disable |
rvolosatovs
changed the title
Service key "expose" functionality is flaky
Service key "expose" functionality is flaky on big changes
Aug 9, 2022
rvolosatovs
added a commit
that referenced
this issue
Aug 9, 2022
Ideally, this should not be necessary, but it's required due to #109 Signed-off-by: Roman Volosatovs <[email protected]>
rvolosatovs
added a commit
that referenced
this issue
Aug 9, 2022
Ideally, this should not be necessary, but it's required due to #109 Signed-off-by: Roman Volosatovs <[email protected]>
A workaround was applied in 31930cb, where we ensure that |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Sometimes,
expose-key
script (infrastructure/lib/scripts.nix
Lines 2 to 6 in 996aa9b
ExecStartPre
infrastructure/lib/systemd.nix
Line 6 in 996aa9b
Fails with (example from sgx.equinix.try.enarx.dev):
benefice:benefice
should be created by systemd due toDynamicUser=true
, but in some cases it is apparently not created. It could also perhaps be a race condition?Not sure.
One of the options to work around this could be relying on https://search.nixos.org/options?channel=22.05&show=systemd.services.%3Cname%3E.script&from=0&size=50&sort=relevance&type=packages&query=systemd.services.*.script/ in our module definitions to attempt to do this step in
ExecStart
(the way this option works, is that add definitions of it are merged into one script and that resulting script is then set as theExecStart
). I believe that if the user/group does not exist yet at that point, then that should be Systemd bug.To work around this issue, we currently have to temporarily disable this functionality and run services as root. On a repeated deployment this issue does not occur.
We could also, of course, poll in
ExecStartPre
until a user and group are created, but that's ugly and error-prone@puiterwijk any ideas?
The text was updated successfully, but these errors were encountered: