systemd: convert mongodb job to service

This commit is contained in:
Mathijs Kwik 2012-12-18 20:20:50 +01:00
parent e9784da0e0
commit 90fa68cf32
1 changed files with 8 additions and 10 deletions

View File

@ -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;
};
};
};