systemd: convert mongodb job to service
This commit is contained in:
parent
e9784da0e0
commit
90fa68cf32
|
@ -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";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue