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 users.extraUsers = singleton
{ name = cfg.user; { name = cfg.user;
shell = "/bin/sh";
description = "MongoDB server user"; description = "MongoDB server user";
}; };
environment.systemPackages = [mongodb]; environment.systemPackages = [ mongodb ];
jobs.mongodb = boot.systemd.services.mongodb =
{ description = "MongoDB server"; { description = "MongoDB server";
daemonType = "daemon";
startOn = "filesystem"; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
preStart = preStart =
'' ''
@ -117,11 +116,10 @@ in
fi fi
''; '';
path = [mongodb]; serviceConfig = {
exec = "mongod --config ${mongoCnf} --fork"; ExecStart = "${mongodb}/bin/mongod --quiet --config ${mongoCnf}";
setuid = cfg.user; User = cfg.user;
};
extraConfig = "kill timeout 10";
}; };
}; };