X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=servers%2Fslapd%2Fmain.c;h=61dc82e12186bb0210fdedbaf51460e4b5c37de8;hb=a78c03bb4a9285d5a42dc7907fc212dbf162a7c1;hp=3667b07a4e16f171466d467338a89559078b651d;hpb=3b01c9a99e52b40f733b30f879938657829e97f0;p=openldap diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 3667b07a4e..61dc82e121 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -151,6 +151,8 @@ int main( int argc, char **argv ) } #endif + sl_mem_init(); + #ifdef HAVE_NT_SERVICE_MANAGER { int *i; @@ -360,6 +362,8 @@ int main( int argc, char **argv ) #endif extops_init(); + lutil_passwd_init(); + slap_op_init(); #ifdef SLAPD_MODULES if ( module_init() != 0 ) { @@ -369,12 +373,6 @@ int main( int argc, char **argv ) } #endif - if ( slap_init( serverMode, serverName ) != 0 ) { - rc = 1; - SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 18 ); - goto destroy; - } - if ( slap_schema_init( ) != 0 ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, CRIT, "main: schema initialization error\n", 0, 0, 0 ); @@ -387,6 +385,12 @@ int main( int argc, char **argv ) goto destroy; } + if ( slap_init( serverMode, serverName ) != 0 ) { + rc = 1; + SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 18 ); + goto destroy; + } + if ( slap_controls_init( ) != 0 ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, CRIT, "main: controls initialization error\n", 0, 0, 0 ); @@ -520,6 +524,12 @@ int main( int argc, char **argv ) mal_leaktrace(1); #endif + /* + * FIXME: moved here from slapd_daemon_task() + * because back-monitor db_open() needs it + */ + time( &starttime ); + if ( slap_startup( NULL ) != 0 ) { rc = 1; SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 21 ); @@ -586,6 +596,8 @@ destroy: module_kill(); #endif + slap_op_destroy(); + extops_kill(); stop: @@ -614,6 +626,8 @@ stop: schema_destroy(); + lutil_passwd_destroy(); + #ifdef HAVE_TLS ldap_pvt_tls_destroy(); #endif