From c6efa9fd2d0bc9353ffc3dd497f677d7c49a3a11 Mon Sep 17 00:00:00 2001 From: talyz Date: Thu, 3 Oct 2019 14:38:54 +0200 Subject: [PATCH] nixos/gitlab: Clean up the initializers on start The initializers directory is populated with files from the gitlab distribution on start, but old files will be left in the state folder even if they're removed from the distribution, which can lead to startup failures. Fix this by always purging the directory on start before populating it. --- nixos/modules/services/misc/gitlab.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index 58ef463c49ec..0b15b40c72c3 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -780,6 +780,7 @@ in { preStart = '' cp -f ${cfg.packages.gitlab}/share/gitlab/VERSION ${cfg.statePath}/VERSION rm -rf ${cfg.statePath}/db/* + rm -rf ${cfg.statePath}/config/initializers/* cp -rf --no-preserve=mode ${cfg.packages.gitlab}/share/gitlab/config.dist/* ${cfg.statePath}/config cp -rf --no-preserve=mode ${cfg.packages.gitlab}/share/gitlab/db/* ${cfg.statePath}/db