From fa9d0e6caff8a5187d9e67c6fd37bde541b820b3 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Mon, 24 Jul 2023 22:48:39 +0200 Subject: [PATCH] nixos/gitlab: ensure service started again after dependency restarts When a dependency, like postgresql.service or redis-gitlab.service, had been stopped and started at switch-to-configuration time, gitlab.service and its helper units had been stopped but not started again. `multi-user.target` only has a `Wants` relation to gitlab.target, but once gitlab.target has been successfully started once and is not stopped/ restarted again, it does not cause all its dependencies to stay activated the whole time. This commit fixes this by upgrading the dependy relationship of gitlab.service towards gitlab.target from a "Wants" to a "Requires". It should be enough to do this for this single unit part of gitlab.target only, as all other units wantedBy gitlab.target are pulled in by gitlab.service as well or have bindsTo relations. (cherry picked from commit 94e8de11734c2cd64ab73fbe10f6da54425d514a) --- nixos/modules/services/misc/gitlab.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index a442cb237edc..0757775f9af3 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -1635,7 +1635,7 @@ in { "gitlab-config.service" "gitlab-db-config.service" ] ++ optional (cfg.databaseHost == "") "postgresql.service"; - wantedBy = [ "gitlab.target" ]; + requiredBy = [ "gitlab.target" ]; partOf = [ "gitlab.target" ]; environment = gitlabEnv; path = with pkgs; [