diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index ff0c569e36..42bb931ca6 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -3270,13 +3270,46 @@ slap_sig_wake( int sig ) int slap_pause_server( void ) { - return ldap_pvt_thread_pool_pause( &connection_pool ); + BackendInfo *bi; + int rc = LDAP_SUCCESS; + + rc = ldap_pvt_thread_pool_pause( &connection_pool ); + + LDAP_STAILQ_FOREACH(bi, &backendInfo, bi_next) { + if ( bi->bi_pause ) { + rc = bi->bi_pause( bi ); + if ( rc != LDAP_SUCCESS ) { + Debug( LDAP_DEBUG_ANY, "slap_pause_server: " + "bi_pause failed for backend %s\n", + bi->bi_type, 0, 0 ); + return rc; + } + } + } + + return rc; } int slap_unpause_server( void ) { - return ldap_pvt_thread_pool_resume( &connection_pool ); + BackendInfo *bi; + int rc = LDAP_SUCCESS; + + LDAP_STAILQ_FOREACH(bi, &backendInfo, bi_next) { + if ( bi->bi_unpause ) { + rc = bi->bi_unpause( bi ); + if ( rc != LDAP_SUCCESS ) { + Debug( LDAP_DEBUG_ANY, "slap_unpause_server: " + "bi_unpause failed for backend %s\n", + bi->bi_type, 0, 0 ); + return rc; + } + } + } + + rc = ldap_pvt_thread_pool_resume( &connection_pool ); + return rc; } diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index b51b5571b6..ef2d0b2af5 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1992,6 +1992,8 @@ struct BackendDB { typedef int (BI_bi_func) LDAP_P((BackendInfo *bi)); typedef BI_bi_func BI_init; typedef BI_bi_func BI_open; +typedef BI_bi_func BI_pause; +typedef BI_bi_func BI_unpause; typedef BI_bi_func BI_close; typedef BI_bi_func BI_destroy; typedef int (BI_config) LDAP_P((BackendInfo *bi, @@ -2251,6 +2253,8 @@ struct BackendInfo { BI_init *bi_init; BI_config *bi_config; BI_open *bi_open; + BI_pause *bi_pause; + BI_unpause *bi_unpause; BI_close *bi_close; BI_destroy *bi_destroy;