containers icon indicating copy to clipboard operation
containers copied to clipboard

ldap26 fixinng ldap is not ready in initialization

Open nix-power opened this issue 3 weeks ago • 2 comments

Fixes https://github.com/bitnami/containers/issues/65109

nix-power avatar Nov 26 '25 22:11 nix-power

Hi @nix-power

Thanks for using Bitnami and for your contribution. Checking your changes I think you could increase the retries and sleep_time values in the ldap_start_bg() method to get the same effect. Is that correct? In that case, what do you think about providing the ldap_start_bg() function with the custom values via environment variables?

https://github.com/bitnami/containers/blob/c8da36a2b6af4122e509cf2b870b992845817ddf/bitnami/openldap/2.6/debian-12/rootfs/opt/bitnami/scripts/libopenldap.sh#L237

gongomgra avatar Dec 05 '25 15:12 gongomgra

Hi @gongomgra The issue is that ldap_start_bg() relies on is_ldap_running(), which in turn calls the is_service_running() helper from libservice.sh. This helper only verifies that the PID exists in the process table by sending signal 0 with kill:

is_service_running() {
    local pid="${1:?pid is missing}"

    kill -0 "$pid" 2>/dev/null
}

This check returns very quickly, but the mere existence of a process in the process table does not guarantee that the LDAP server is fully initialized or ready to accept connections. As a result, simply increasing the number of retries and/or the sleep interval will not solve the problem, because we are still only checking for process existence rather than actual service readiness.

nix-power avatar Dec 05 '25 21:12 nix-power

Can you please review my latest comment ?

nix-power avatar Dec 18 '25 07:12 nix-power

Hi @nix-power

Sorry for the delay, and thank you for the clarification. Let me take a look.

gongomgra avatar Dec 18 '25 08:12 gongomgra