nslcd: Adjust service definition to systemd

This commit is contained in:
Rickard Nilsson 2013-01-27 20:07:37 +01:00
parent 5eb6e7a21e
commit 27414c4656

View File

@ -220,18 +220,15 @@ mkIf cfg.enable {
};
};
jobs = mkIf cfg.daemon.enable {
systemd.services = mkIf cfg.daemon.enable {
nslcd = {
startOn = "filesystem";
stopOn = "stopping network-interfaces";
daemonType = "fork";
wantedBy = [ "nss-user-lookup.target" ];
path = [ nss_pam_ldapd ];
preStart = ''
mkdir -p /run/nslcd
rm -f /run/nslcd/nslcd.pid;
chown nslcd.nslcd /run/nslcd
${optionalString (cfg.bind.distinguishedName != "") ''
if test -s "${cfg.bind.password}" ; then
@ -240,9 +237,13 @@ mkIf cfg.enable {
''}
'';
postStop = "rm -f /run/nslcd/nslcd.pid";
script = "nslcd";
exec = "nslcd";
serviceConfig = {
Type = "forking";
PIDFile = "/run/nslcd/nslcd.pid";
Restart = "always";
};
};
};
}