Browse Source

Bug 606439 - Creating server instance with LDAPI takes too long

The setup-ds.pl script expects ns-slapd to write a "slapd started"
message to the errors log when the server comes up.  When you
create an instance that does not listen on a standard LDAP port,
the "slapd started" string is never printed.  This causes the
installer to hang for 10 minutes, at which point in prints an error
that it could not create the instance.

This patch ensures that the "slapd started" message is printed
for servers that only listen on LDAPS or LDAPI interfaces.
Nathan Kinder 15 years ago
parent
commit
d9cac184c8
1 changed files with 16 additions and 6 deletions
  1. 16 6
      ldap/servers/slapd/daemon.c

+ 16 - 6
ldap/servers/slapd/daemon.c

@@ -2300,6 +2300,7 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
 {
 	slapdFrontendConfig_t	*slapdFrontendConfig = getFrontendConfig();
 	char					addrbuf[ 256 ];
+	int			isfirsttime = 1;
 
 	if ( ct->size <= slapdFrontendConfig->reservedescriptors ) {
 #ifdef _WIN32
@@ -2340,7 +2341,6 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
 #if !defined( XP_WIN32 )
 	if ( n_tcps != NULL ) {					/* standard LDAP */
 		PRNetAddr   **nap = NULL;
-		int isfirsttime = 1;
 
 		for (nap = ports->n_listenaddr; nap && *nap; nap++) {
 			if (isfirsttime) {
@@ -2362,10 +2362,18 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
 		PRNetAddr   **sap = NULL;
 
 		for (sap = ports->s_listenaddr; sap && *sap; sap++) {
-			LDAPDebug( LDAP_DEBUG_ANY,
-				"Listening on %s port %d for LDAPS requests\n",
-				netaddr2string(*sap, addrbuf, sizeof(addrbuf)),
-				ports->s_port, 0 );
+			if (isfirsttime) {
+				LDAPDebug( LDAP_DEBUG_ANY,
+					"slapd started.  Listening on %s port %d for LDAPS requests\n",
+					netaddr2string(*sap, addrbuf, sizeof(addrbuf)),
+					ports->s_port, 0 );
+				isfirsttime = 0;
+			} else {
+				LDAPDebug( LDAP_DEBUG_ANY,
+					"Listening on %s port %d for LDAPS requests\n",
+					netaddr2string(*sap, addrbuf, sizeof(addrbuf)),
+					ports->s_port, 0 );
+			}
 		}
 	}
 #else
@@ -2388,8 +2396,10 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
 #if defined(ENABLE_LDAPI)
 	if ( i_unix != NULL ) {                                 /* LDAPI */
 		PRNetAddr   **iap = ports->i_listenaddr;
+
 		LDAPDebug( LDAP_DEBUG_ANY,
-			"Listening on %s for LDAPI requests\n", (*iap)->local.path, 0, 0 );
+			"%sListening on %s for LDAPI requests\n", isfirsttime?"slapd started.  ":"",
+			(*iap)->local.path, 0 );
 	}
 #endif /* ENABLE_LDAPI */
 #endif