]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slapcommon.c
Multi-threaded slapindex
[openldap] / servers / slapd / slapcommon.c
index bbdb5bb3e3556b8c5aa6f35df750c4682ef5177d..0cf108c72c0afb49d940983db44d4f7ee224b363 100644 (file)
@@ -62,7 +62,7 @@ usage( int tool, const char *progname )
                break;
 
        case SLAPADD:
-               options = " [-c]\n\t[-n databasenumber | -b suffix]\n"
+               options = " [-c]\n\t[-g] [-n databasenumber | -b suffix]\n"
                        "\t[-l ldiffile] [-q] [-u] [-w]\n";
                break;
 
@@ -71,7 +71,7 @@ usage( int tool, const char *progname )
                break;
 
        case SLAPCAT:
-               options = " [-c]\n\t[-n databasenumber | -b suffix]"
+               options = " [-c]\n\t[-g] [-n databasenumber | -b suffix]"
                        " [-l ldiffile] [-a filter]\n";
                break;
 
@@ -80,7 +80,7 @@ usage( int tool, const char *progname )
                break;
 
        case SLAPINDEX:
-               options = " [-c]\n\t[-n databasenumber | -b suffix] [-q]\n";
+               options = " [-c]\n\t[-g] [-n databasenumber | -b suffix] [-q]\n";
                break;
 
        case SLAPTEST:
@@ -178,6 +178,7 @@ slap_tool_init(
        int rc, i, dbnum;
        int mode = SLAP_TOOL_MODE;
        int truncatemode = 0;
+       int use_glue = 1;
 
 #ifdef CSRIMALLOC
        leakfilename = malloc( strlen( progname ) + STRLENOF( ".leak" ) + 1 );
@@ -190,11 +191,11 @@ slap_tool_init(
 
        switch( tool ) {
        case SLAPADD:
-               options = "b:cd:f:F:l:n:qtuvw";
+               options = "b:cd:f:F:gl:n:qtuvw";
                break;
 
        case SLAPCAT:
-               options = "a:b:cd:f:F:l:n:s:v";
+               options = "a:b:cd:f:F:gl:n:s:v";
                mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY;
                break;
 
@@ -214,7 +215,7 @@ slap_tool_init(
                break;
 
        case SLAPINDEX:
-               options = "b:cd:f:F:n:qv";
+               options = "b:cd:f:F:gn:qv";
                mode |= SLAP_TOOL_READMAIN;
                break;
 
@@ -259,6 +260,10 @@ slap_tool_init(
                        confdir = strdup( optarg );
                        break;
 
+               case 'g':       /* disable subordinate glue */
+                       use_glue = 0;
+                       break;
+
                case 'l':       /* LDIF file */
                        ldiffile = strdup( optarg );
                        break;
@@ -424,11 +429,14 @@ slap_tool_init(
                break;
        }
 
-       rc = glue_sub_init();
+       if ( use_glue ) {
+               rc = glue_sub_attach();
 
-       if ( rc != 0 ) {
-               fprintf( stderr, "%s: subordinate configuration error\n", progname );
-               exit( EXIT_FAILURE );
+               if ( rc != 0 ) {
+                       fprintf( stderr,
+                               "%s: subordinate configuration error\n", progname );
+                       exit( EXIT_FAILURE );
+               }
        }
 
        rc = slap_schema_check();