mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
nslcd: Adjust service definition to systemd
This commit is contained in:
parent
5eb6e7a21e
commit
27414c4656
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user