Commit a3f18688 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#9351 - Always build back-monitor as a static backend

parent c59ccf53
......@@ -294,7 +294,6 @@ Backends="dnssrv \
mdb \
meta \
asyncmeta \
monitor \
ndb \
null \
passwd \
......@@ -320,8 +319,6 @@ OL_ARG_ENABLE(meta, [AS_HELP_STRING([--enable-meta], [enable metadirectory backe
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(asyncmeta, [AS_HELP_STRING([--enable-asyncmeta], [enable asynchronous metadirectory backend])],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(monitor, [AS_HELP_STRING([--enable-monitor], [enable monitor backend])],
yes, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(ndb, [AS_HELP_STRING([--enable-ndb], [enable MySQL NDB Cluster backend])],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(null, [AS_HELP_STRING([--enable-null], [enable null backend])],
......@@ -525,7 +522,6 @@ BUILD_LDAP=no
BUILD_MDB=no
BUILD_META=no
BUILD_ASYNCMETA=no
BUILD_MONITOR=no
BUILD_NDB=no
BUILD_NULL=no
BUILD_PASSWD=no
......@@ -565,7 +561,7 @@ SLAPD_DYNAMIC_OVERLAYS=
SLAPD_MODULES_LDFLAGS=
SLAPD_MODULES_CPPFLAGS=
SLAPD_STATIC_BACKENDS=back-ldif
SLAPD_STATIC_BACKENDS="back-ldif back-monitor"
SLAPD_DYNAMIC_BACKENDS=
SLAPD_PERL_LDFLAGS=
......@@ -2493,20 +2489,6 @@ fi
AC_DEFINE(SLAPD_MOD_STATIC,1,[statically linked module])
AC_DEFINE(SLAPD_MOD_DYNAMIC,2,[dynamically linked module])
dnl back-monitor goes first (well, after back-config)
if test "$ol_enable_monitor" != no ; then
BUILD_SLAPD=yes
BUILD_MONITOR=$ol_enable_monitor
if test "$ol_enable_monitor" = mod ; then
SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
MFLAG=SLAPD_MOD_DYNAMIC
else
SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
MFLAG=SLAPD_MOD_STATIC
fi
AC_DEFINE_UNQUOTED(SLAPD_MONITOR,$MFLAG,[define to support cn=Monitor backend])
fi
if test "$ol_enable_dnssrv" != no ; then
BUILD_SLAPD=yes
BUILD_DNSSRV=$ol_enable_dnssrv
......@@ -2987,7 +2969,6 @@ dnl backends
AC_SUBST(BUILD_MDB)
AC_SUBST(BUILD_META)
AC_SUBST(BUILD_ASYNCMETA)
AC_SUBST(BUILD_MONITOR)
AC_SUBST(BUILD_NDB)
AC_SUBST(BUILD_NULL)
AC_SUBST(BUILD_PASSWD)
......
......@@ -937,7 +937,6 @@ The following example is for a self-contained push-based replication solution:
> modulepath /usr/local/libexec/openldap
> moduleload back_mdb.la
> moduleload syncprov.la
> moduleload back_monitor.la
> moduleload back_ldap.la
>
> pidfile /usr/local/var/slapd.pid
......@@ -1021,7 +1020,6 @@ A replica configuration for this type of setup could be:
> modulepath /usr/local/libexec/openldap
> moduleload back_mdb.la
> moduleload syncprov.la
> moduleload back_monitor.la
> moduleload back_ldap.la
>
> pidfile /usr/local/var/slapd.pid
......
......@@ -936,9 +936,6 @@
/* statically linked module */
#undef SLAPD_MOD_STATIC
/* define to support cn=Monitor backend */
#undef SLAPD_MONITOR
/* define to support NDB backend */
#undef SLAPD_NDB
......
......@@ -844,8 +844,7 @@ ldap_back_monitor_initialize( void )
/* set to 0 when successfully initialized; otherwise, remember failure */
static int ldap_back_monitor_initialized_failure = 1;
/* register schema here; if compiled as dynamic object,
* must be loaded __after__ back_monitor.la */
/* register schema here */
if ( ldap_back_monitor_initialized++ ) {
return ldap_back_monitor_initialized_failure;
......
......@@ -28,10 +28,10 @@ LDAP_INCDIR= ../../../include
LDAP_LIBDIR= ../../../libraries
BUILD_OPT = "--enable-monitor"
BUILD_MOD = @BUILD_MONITOR@
BUILD_MOD = yes
mod_DEFS = -DSLAPD_IMPORT
MOD_DEFS = $(@BUILD_MONITOR@_DEFS)
MOD_DEFS = $(yes_DEFS)
shared_LDAP_LIBS = $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
NT_LINK_LIBS = -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
......
......@@ -2562,11 +2562,3 @@ monitor_back_db_destroy(
return 0;
}
#if SLAPD_MONITOR == SLAPD_MOD_DYNAMIC
/* conditionally define the init_module() function */
SLAP_BACKEND_INIT_MODULE( monitor )
#endif /* SLAPD_MONITOR == SLAPD_MOD_DYNAMIC */
......@@ -116,11 +116,8 @@ int backend_init(void)
LDAP_STAILQ_INSERT_TAIL(&backendInfo, bi, bi_next);
}
#if defined(SLAPD_MONITOR) && SLAPD_MONITOR == SLAPD_MOD_STATIC
/* HACK: need schema defined in deterministic order */
syncrepl_monitor_init();
#endif
if ( nBackendInfo > 0) {
return 0;
......
......@@ -306,13 +306,8 @@ static Connection* connection_get( ber_socket_t s )
assert( c->c_conn_state != SLAP_C_INVALID );
assert( c->c_sd != AC_SOCKET_INVALID );
#ifndef SLAPD_MONITOR
if ( global_idletimeout > 0 )
#endif /* ! SLAPD_MONITOR */
{
c->c_activitytime = slap_get_time();
}
}
return c;
}
......@@ -463,12 +458,7 @@ Connection * connection_init(
/* set to zero until bind, implies LDAP_VERSION3 */
c->c_protocol = 0;
#ifndef SLAPD_MONITOR
if ( global_idletimeout > 0 )
#endif /* ! SLAPD_MONITOR */
{
c->c_activitytime = c->c_starttime = slap_get_time();
}
#ifdef LDAP_CONNECTIONLESS
c->c_is_udp = 0;
......@@ -960,7 +950,6 @@ void connection_done( Connection *c )
* calls the appropriate stub to handle it.
*/
#ifdef SLAPD_MONITOR
/* FIXME: returns 0 in case of failure */
#define INCR_OP_INITIATED(index) \
do { \
......@@ -975,15 +964,6 @@ void connection_done( Connection *c )
ldap_pvt_mp_add_ulong(op->o_counters->sc_ops_completed_[(index)], 1); \
ldap_pvt_thread_mutex_unlock( &op->o_counters->sc_mutex ); \
} while (0)
#else /* !SLAPD_MONITOR */
#define INCR_OP_INITIATED(index) do { } while (0)
#define INCR_OP_COMPLETED(index) \
do { \
ldap_pvt_thread_mutex_lock( &op->o_counters->sc_mutex ); \
ldap_pvt_mp_add_ulong(op->o_counters->sc_ops_completed, 1); \
ldap_pvt_thread_mutex_unlock( &op->o_counters->sc_mutex ); \
} while (0)
#endif /* !SLAPD_MONITOR */
/*
* NOTE: keep in sync with enum in slapd.h
......@@ -1023,12 +1003,10 @@ conn_counter_destroy( void *key, void *data )
ldap_pvt_mp_add( slap_counters.sc_refs, sc->sc_refs );
ldap_pvt_mp_add( slap_counters.sc_ops_initiated, sc->sc_ops_initiated );
ldap_pvt_mp_add( slap_counters.sc_ops_completed, sc->sc_ops_completed );
#ifdef SLAPD_MONITOR
for ( i = 0; i < SLAP_OP_LAST; i++ ) {
ldap_pvt_mp_add( slap_counters.sc_ops_initiated_[ i ], sc->sc_ops_initiated_[ i ] );
ldap_pvt_mp_add( slap_counters.sc_ops_initiated_[ i ], sc->sc_ops_completed_[ i ] );
}
#endif /* SLAPD_MONITOR */
slap_counters_destroy( sc );
ber_memfree_x( data, NULL );
break;
......
......@@ -297,12 +297,10 @@ void slap_counters_init( slap_counters_t *sc )
ldap_pvt_mp_init( sc->sc_ops_initiated );
ldap_pvt_mp_init( sc->sc_ops_completed );
#ifdef SLAPD_MONITOR
for ( i = 0; i < SLAP_OP_LAST; i++ ) {
ldap_pvt_mp_init( sc->sc_ops_initiated_[ i ] );
ldap_pvt_mp_init( sc->sc_ops_completed_[ i ] );
}
#endif /* SLAPD_MONITOR */
}
void slap_counters_destroy( slap_counters_t *sc )
......@@ -318,11 +316,9 @@ void slap_counters_destroy( slap_counters_t *sc )
ldap_pvt_mp_clear( sc->sc_ops_initiated );
ldap_pvt_mp_clear( sc->sc_ops_completed );
#ifdef SLAPD_MONITOR
for ( i = 0; i < SLAP_OP_LAST; i++ ) {
ldap_pvt_mp_clear( sc->sc_ops_initiated_[ i ] );
ldap_pvt_mp_clear( sc->sc_ops_completed_[ i ] );
}
#endif /* SLAPD_MONITOR */
}
......@@ -2551,10 +2551,8 @@ typedef struct slap_counters_t {
ldap_pvt_mp_t sc_ops_completed;
ldap_pvt_mp_t sc_ops_initiated;
#ifdef SLAPD_MONITOR
ldap_pvt_mp_t sc_ops_completed_[SLAP_OP_LAST];
ldap_pvt_mp_t sc_ops_initiated_[SLAP_OP_LAST];
#endif /* SLAPD_MONITOR */
} slap_counters_t;
/*
......
......@@ -24,7 +24,7 @@ USER="uid=user1,ou=People,dc=example,dc=com"
PASS="abc"
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $ITSDIR/slapd.conf > $CONF1
. $CONFFILTER $BACKEND < $ITSDIR/slapd.conf > $CONF1
$SLAPADD -f $CONF1 -l $ITSDIR/adds.ldif
RC=$?
if test $RC != 0 ; then
......
......@@ -32,7 +32,7 @@ ITS=4326
ITSDIR=$DATADIR/regressions/its$ITS
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
. $CONFFILTER $BACKEND < $CONF > $CONF1
$SLAPADD -f $CONF1 -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
......@@ -70,7 +70,7 @@ if test $RC != 0 ; then
fi
echo "Starting proxy slapd on TCP/IP port $PORT2..."
. $CONFFILTER $BACKEND $MONITORDB < $ITSDIR/slapd.conf > $CONF2
. $CONFFILTER $BACKEND < $ITSDIR/slapd.conf > $CONF2
$SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 &
PROXYPID=$!
if test $WAIT != 0 ; then
......
......@@ -26,8 +26,6 @@ argsfile @TESTDIR@/slapd.2.args
#ldapmod#modulepath ../servers/slapd/back-ldap/
#ldapmod#moduleload back_ldap.la
#monitormod#modulepath ../servers/slapd/back-monitor/
#monitormod#moduleload back_monitor.la
#######################################################################
# database definitions
......@@ -42,4 +40,4 @@ idassert-bind bindmethod=simple
mode=self
flags=non-prescriptive
#monitor#database monitor
database monitor
......@@ -37,7 +37,7 @@ ITS=4336
ITSDIR=$DATADIR/regressions/its$ITS
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $RETCODECONF > $CONF1
. $CONFFILTER $BACKEND < $RETCODECONF > $CONF1
$SLAPADD -f $CONF1 -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
......@@ -75,7 +75,7 @@ if test $RC != 0 ; then
fi
echo "Starting chain slapd on TCP/IP port $PORT2..."
. $CONFFILTER $BACKEND $MONITORDB < $ITSDIR/slapd.conf > $CONF2
. $CONFFILTER $BACKEND < $ITSDIR/slapd.conf > $CONF2
$SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 &
PROXYPID=$!
if test $WAIT != 0 ; then
......
......@@ -27,11 +27,8 @@ argsfile @TESTDIR@/slapd.2.args
#ldapmod#modulepath ../servers/slapd/back-ldap/
#ldapmod#moduleload back_ldap.la
#monitormod#modulepath ../servers/slapd/back-monitor/
#monitormod#moduleload back_monitor.la
# no database; only a referral to another DSA, with anonymous chaining
referral "@URI1@"
overlay chain
#monitor#database monitor
database monitor
......@@ -48,7 +48,7 @@ ITSDIR=$DATADIR/regressions/its$ITS
ITSCONF=$ITSDIR/slapd-meta.conf
echo "Starting slapd on TCP/IP port $PORT1..."
. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
. $CONFFILTER $BACKEND < $CONF > $CONF1
$SLAPD -f $CONF1 -h $URI1 -d $LVL > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
......@@ -104,7 +104,7 @@ if test $RC != 0 ; then
fi
echo "Starting slapd on TCP/IP port $PORT2..."
. $CONFFILTER $BACKEND $MONITORDB < $METACONF2 > $CONF2
. $CONFFILTER $BACKEND < $METACONF2 > $CONF2
$SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 &
PID=$!
if test $WAIT != 0 ; then
......@@ -143,7 +143,7 @@ if test $RC != 0 ; then
fi
echo "Starting slapd on TCP/IP port $PORT3..."
. $CONFFILTER $BACKEND $MONITORDB < $ITSCONF > $CONF3
. $CONFFILTER $BACKEND < $ITSCONF > $CONF3
$SLAPD -f $CONF3 -h $URI3 -d $LVL > $LOG3 2>&1 &
PID=$!
if test $WAIT != 0 ; then
......
......@@ -29,8 +29,6 @@ argsfile @TESTDIR@/slapd.m.args
#ldapmod#moduleload back_ldap.la
#metamod#modulepath ../servers/slapd/back-meta/
#metamod#moduleload back_meta.la
#monitormod#modulepath ../servers/slapd/back-monitor/
#monitormod#moduleload back_monitor.la
#rwmmod#modulepath ../servers/slapd/overlays/
#rwmmod#moduleload rwm.la
......@@ -57,4 +55,4 @@ idassert-bind bindmethod=simple
mode=none
idassert-authzFrom "*"
#monitor#database monitor
database monitor
......@@ -24,7 +24,7 @@ ITSDIR=$DATADIR/regressions/its$ITS
ITSCONF=$ITSDIR/slapd-glue.conf
echo "Running multi-threaded slapadd in quick mode to build glued slapd databases..."
. $CONFFILTER $BACKEND $MONITORDB < $ITSCONF > $CONF1
. $CONFFILTER $BACKEND < $ITSCONF > $CONF1
$SLAPADD -q -d $LVL -f $CONF1 -l $LDIFORDERED > $SLAPADDLOG1 2>&1
RC=$?
if test $RC != 0 ; then
......
......@@ -23,8 +23,6 @@ argsfile @TESTDIR@/slapd.1.args
#mod#modulepath ../servers/slapd/back-@BACKEND@/
#mod#moduleload back_@BACKEND@.la
#monitormod#modulepath ../servers/slapd/back-monitor/
#monitormod#moduleload back_monitor.la
tool-threads 4
#######################################################################
# database definitions
......@@ -63,4 +61,4 @@ rootpw secret
#ndb#dbname db_3
#ndb#include @DATADIR@/ndb.conf
#monitor#database monitor
database monitor
......@@ -31,7 +31,7 @@ cp $PERLPM $TESTDIR
$SLAPPASSWD -g -n >$CONFIGPWF
echo "Starting slapd on TCP/IP port $PORT1... $PWD"
. $CONFFILTER $BACKEND $MONITORDB < $DYNAMICCONF > $CONFLDIF
. $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF
$SLAPADD -F $CONFDIR -n 0 -l $CONFLDIF
cd $TESTDIR
$SLAPD -F ./slapd.d -h $URI1 -d $LVL > $LOG1 2>&1 &
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment