diff --git a/modules/services/databases/mongodb.nix b/modules/services/databases/mongodb.nix index caa6ebc5acf5..28d2a4f849c0 100644 --- a/modules/services/databases/mongodb.nix +++ b/modules/services/databases/mongodb.nix @@ -96,7 +96,7 @@ in jobs.mongodb = { description = "MongoDB server"; - daemonType = "fork"; + daemonType = "daemon"; startOn = "filesystem"; @@ -108,7 +108,9 @@ in fi ''; - exec = "${pkgs.shadow}/bin/su ${cfg.user} -c \"${mongodb}/bin/mongod --config ${mongoCnf}\""; + path = [mongodb]; + exec = "mongod --config ${mongoCnf} --fork"; + setuid = cfg.user; extraConfig = "kill timeout 10"; };