#1105864 nss-pam-ldapd-0.9.12: Very slow start

Package:
nss-pam-ldapd-0.9.12
Source:
nss-pam-ldapd-0.9.12
Submitter:
Rolf Stenholm (D2I)
Date:
2025-05-17 11:03:02 UTC
Severity:
normal
Tags:
#1105864#5
Date:
2025-05-16 11:21:07 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

   from console start nslcd , doesn't matter if nslcd -h, nslcd -d or nslcd is used.

   * What was the outcome of this action?

   The nslcd program starts using maximum available processor for a couple of minutes and then starts responding.

   * What outcome did you expect instead?

   The nslcd command should respond instantly to nslcd -h and nslcd -d and to basically and start method.

   * Quick fix of issue

   write ulimit -n 1024 before staring app (or add in startup script)

   * Details about the error

   I looked into the code and compiled it and found the latest daemonizer.c file has not been updated in three years
   in the latest by the maintainers. In this file there is the function "closefrom" that solves the startup issues
   which is not present in the shipped debian version.
   In the shipped debian version sysconf(_SC_OPEN_MAX) returns a very large number running in Docker for some reason
   that has the effect of making startup take minutes for this application. This can be fixed by using ulimit command
   from shell to reduce the number of maximum open files. Similar issues exist in LDAP packages in debian resulting in
   slow start and large resource usage (memory CPU), while it may be possible to fix using Docker settings having a
   high max file limit should not cause issues for code to run.

#1105864#14
Date:
2025-05-17 10:54:38 UTC
From:
To:
Control: tags -1 + fixed-upstream patch
Control: found -1 nss-pam-ldapd/0.9.12-4
Control: fixed -1 nss-pam-ldapd/0.9.13-1
[...]
around using `ulimit -n 1024`.

This has already been fixed in version 0.9.13 of nss-pam-ldapd as it
was originally reported in
https://github.com/arthurdejong/nss-pam-ldapd/issues/53

The fix is here:
https://arthurdejong.org/git/nss-pam-ldapd/commit/?id=2f6e65ab384917a9b2ee4b25a172acc107a640b3


Not sure if this appropriate for a release via stable-updates though
but I've pushed a change to the debian/bookworm branch with the
appropriate fix:
https://salsa.debian.org/debian/nss-pam-ldapd/-/tree/debian/bookworm

Kind regards,