[Pkg-openldap-devel] Bug#696563: slapd not ready when start script exits, plase add sleep in starting script
Fabien C.
kmstrj5c1e6z281 at jetable.org
Sat Dec 22 22:03:28 UTC 2012
Package: slapd
Version: 2.4.31-1
Severity: normal
Tags: patch
Hello,
I noticed that during bootup, when the /etc/init.d/slapd script returns, the LDAP server is not fully available. I noticed this because, right after, I have my DHCP server (isc-dhcp-server) starting, and the dhcp configuration configuration is within the local LDAP tree. But, on bootup, dhcp fails to start because it cannot connect to the LDAP server:
-----------
dhcpd: Error: Cannot login into ldap server localhost:389: Can't contact LDAP server
dhcpd: Configuration file errors encountered -- exiting
[...]
dhcpd: exiting
-----------
Of course, everything works if I just try to start dhcp manually after bootup.
It is probably necessary to add in the /etc/init.d/slapd script, either a "sleep 2" or more, either a detection of the "readyness" of the slapd daemon. One could also patch the slapd server, so it could handle this situation itself.
--- a/slapd 2012-05-30 04:41:07.000000000 +0200
+++ b/slapd 2012-11-13 15:05:46.194599093 +0100
@@ -146,6 +146,8 @@ start_slapd() {
if [ ! -h /var/run/ldapi ] && [ ! -e /var/run/ldapi ] ; then
ln -s slapd/ldapi /var/run/ldapi
fi
+
+ sleep 2
}
# Stop the slapd daemon and capture the error message (if any) to
Thank you,
Fabien
More information about the Pkg-openldap-devel
mailing list