ldap26 fixinng ldap is not ready in initialization
Fixes https://github.com/bitnami/containers/issues/65109
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
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.
Can you please review my latest comment ?
Hi @nix-power
Sorry for the delay, and thank you for the clarification. Let me take a look.