]> git.sur5r.net Git - openldap/commitdiff
Call SLAPI start/close plugins at init/shutdown time
authorLuke Howard <lukeh@openldap.org>
Sat, 7 Jun 2003 06:32:52 +0000 (06:32 +0000)
committerLuke Howard <lukeh@openldap.org>
Sat, 7 Jun 2003 06:32:52 +0000 (06:32 +0000)
servers/slapd/init.c

index a9031b6f6ba50ab118664daf682d9218faa9b304..1fd63e75dac4073e28a46633343c94a2092d627b 100644 (file)
@@ -15,6 +15,9 @@
 
 #include "slap.h"
 #include "lber_pvt.h"
+#ifdef LDAP_SLAPI
+#include "slapi.h"
+#endif
 
 /*
  * read-only global variables or variables only written by the listener
@@ -141,6 +144,16 @@ slap_init( int mode, const char *name )
                        if( rc == 0 ) {
                                rc = backend_init( );
                        }
+
+#ifdef LDAP_SLAPI
+                       if( rc == 0 ) {
+                               Slapi_PBlock *pb = slapi_pblock_new();
+
+                               rc = doPluginFNs( NULL, SLAPI_PLUGIN_START_FN, pb );
+                               slapi_pblock_destroy( pb );
+                       }
+#endif /* LDAP_SLAPI */
+
                        break;
 
                default:
@@ -180,6 +193,9 @@ int slap_startup( Backend *be )
 int slap_shutdown( Backend *be )
 {
        int rc;
+#ifdef LDAP_SLAPI
+       Slapi_PBlock *pb;
+#endif
 
 #ifdef NEW_LOGGING
        LDAP_LOG( OPERATION, CRIT, 
@@ -196,6 +212,12 @@ int slap_shutdown( Backend *be )
        /* let backends do whatever cleanup they need to do */
        rc = backend_shutdown( be ); 
 
+#ifdef LDAP_SLAPI
+       pb = slapi_pblock_new( );
+       (void) doPluginFNs( NULL, SLAPI_PLUGIN_START_FN, pb );
+       slapi_pblock_destroy( pb );
+#endif /* LDAP_SLAPI */
+
        return rc;
 }