diff options
author | Rich Megginson <rmeggins@redhat.com> | 2007-12-07 00:08:25 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2007-12-07 00:08:25 +0000 |
commit | a09c2cb8bf50719740d3c0bdaeed6bd813abfd50 (patch) | |
tree | 69cafce495deb51003fc6fa5a0d5fe7a0e255879 | |
parent | 07cb20daf83b9ca1d5377406f608f07a3e602f58 (diff) | |
download | ds-a09c2cb8bf50719740d3c0bdaeed6bd813abfd50.tar.gz ds-a09c2cb8bf50719740d3c0bdaeed6bd813abfd50.tar.xz ds-a09c2cb8bf50719740d3c0bdaeed6bd813abfd50.zip |
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
-rw-r--r-- | ldap/admin/src/scripts/DSMigration.pm.in | 10 | ||||
-rw-r--r-- | ldap/admin/src/scripts/Util.pm.in | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/ldap/admin/src/scripts/DSMigration.pm.in b/ldap/admin/src/scripts/DSMigration.pm.in index e500bd26..e5c76582 100644 --- a/ldap/admin/src/scripts/DSMigration.pm.in +++ b/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") { diff --git a/ldap/admin/src/scripts/Util.pm.in b/ldap/admin/src/scripts/Util.pm.in index 7b2e1a5c..9a2cfd23 100644 --- a/ldap/admin/src/scripts/Util.pm.in +++ b/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; |