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 = { nslcd = {
startOn = "filesystem"; wantedBy = [ "nss-user-lookup.target" ];
stopOn = "stopping network-interfaces";
daemonType = "fork";
path = [ nss_pam_ldapd ]; path = [ nss_pam_ldapd ];
preStart = '' preStart = ''
mkdir -p /run/nslcd mkdir -p /run/nslcd
rm -f /run/nslcd/nslcd.pid;
chown nslcd.nslcd /run/nslcd chown nslcd.nslcd /run/nslcd
${optionalString (cfg.bind.distinguishedName != "") '' ${optionalString (cfg.bind.distinguishedName != "") ''
if test -s "${cfg.bind.password}" ; then if test -s "${cfg.bind.password}" ; then
@ -239,10 +236,14 @@ mkIf cfg.enable {
fi fi
''} ''}
''; '';
postStop = "rm -f /run/nslcd/nslcd.pid"; script = "nslcd";
exec = "nslcd"; serviceConfig = {
Type = "forking";
PIDFile = "/run/nslcd/nslcd.pid";
Restart = "always";
};
}; };
}; };
} }