Explorar el Código

Resolves: bug 400421
Bug Description: unable to restart configDS via console
Reviewed by: nhosoi (Thanks!)
Fix Description: We were using the old format for the ldapStart directive, which assumed everything was under a serverroot, so it just stored the relative path. We need the absolute path. During regular setup, we can get this from the directory server instance. During migration, we need to update the ldapStart directive to use the absolute path, so we need to get that information from the directory server code.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none

Rich Megginson hace 18 años
padre
commit
a09c2cb8bf
Se han modificado 2 ficheros con 22 adiciones y 0 borrados
  1. 10 0
      ldap/admin/src/scripts/DSMigration.pm.in
  2. 12 0
      ldap/admin/src/scripts/Util.pm.in

+ 10 - 0
ldap/admin/src/scripts/DSMigration.pm.in

@@ -895,6 +895,16 @@ sub migrateDS {
     my $mig = shift;
     my @errs;
 
+    # migration needs to know the instance directory for the directory
+    # servers - this assumes they are all in the same place
+    if (!$mig->{ServerRoot}) {
+        if ("@with_fhs_opt@") {
+            $mig->{ServerRoot} = "$inf->{General}->{prefix}/opt/@PACKAGE_NAME@";
+        } else {
+            $mig->{ServerRoot} = "$inf->{General}->{prefix}@serverdir@";
+        }
+    }
+
     # for each instance
     foreach my $inst (@{$mig->{instances}}) {
         if (-f "$mig->{configdir}/$inst/dse.ldif") {

+ 12 - 0
ldap/admin/src/scripts/Util.pm.in

@@ -829,8 +829,20 @@ sub createInfFromConfig {
         last if ($ent->hasValue('cn', 'userRoot', 1));
         $ent = $conn->nextEntry();
     }
+
+    # we also need the instance dir
+    $ent = $conn->search("cn=config", "base", "(objectclass=*)");
+    if (!$ent) {
+        push @{$errs}, "error_opening_dseldif", $fname, $!;
+        close $outfh;
+        $conn->close();
+        return 0;
+    }
+    my $inst_dir = $ent->getValue('nsslapd-instancedir');
+
     $conn->close();
 
+    print $outfh, "inst_dir = $inst_dir\n";
     print $outfh "Suffix = $suffix\n";
     close $outfh;