From 90fa68cf32f5ef9b5668ba222805355a95536277 Mon Sep 17 00:00:00 2001 From: Mathijs Kwik Date: Tue, 18 Dec 2012 20:20:50 +0100 Subject: [PATCH] systemd: convert mongodb job to service --- modules/services/databases/mongodb.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/services/databases/mongodb.nix b/modules/services/databases/mongodb.nix index c676d3e96e4..9e9e1c7dd8c 100644 --- a/modules/services/databases/mongodb.nix +++ b/modules/services/databases/mongodb.nix @@ -97,17 +97,16 @@ in users.extraUsers = singleton { name = cfg.user; - shell = "/bin/sh"; description = "MongoDB server user"; }; - environment.systemPackages = [mongodb]; + environment.systemPackages = [ mongodb ]; - jobs.mongodb = + boot.systemd.services.mongodb = { description = "MongoDB server"; - daemonType = "daemon"; - startOn = "filesystem"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; preStart = '' @@ -117,11 +116,10 @@ in fi ''; - path = [mongodb]; - exec = "mongod --config ${mongoCnf} --fork"; - setuid = cfg.user; - - extraConfig = "kill timeout 10"; + serviceConfig = { + ExecStart = "${mongodb}/bin/mongod --quiet --config ${mongoCnf}"; + User = cfg.user; + }; }; };