[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts DSMigration.pm.in, 1.23, 1.24 Util.pm.in, 1.13, 1.14

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Fri Dec 7 00:08:27 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30274/ldapserver/ldap/admin/src/scripts

Modified Files:
	DSMigration.pm.in Util.pm.in 
Log Message:
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



Index: DSMigration.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DSMigration.pm.in,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- DSMigration.pm.in	14 Nov 2007 15:12:09 -0000	1.23
+++ DSMigration.pm.in	7 Dec 2007 00:08:25 -0000	1.24
@@ -895,6 +895,16 @@
     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") {


Index: Util.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Util.pm.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Util.pm.in	21 Nov 2007 20:27:38 -0000	1.13
+++ Util.pm.in	7 Dec 2007 00:08:25 -0000	1.14
@@ -829,8 +829,20 @@
         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;
 




More information about the Fedora-directory-commits mailing list