From a09c2cb8bf50719740d3c0bdaeed6bd813abfd50 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Fri, 7 Dec 2007 00:08:25 +0000 Subject: 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 --- ldap/admin/src/scripts/DSMigration.pm.in | 10 ++++++++++ ldap/admin/src/scripts/Util.pm.in | 12 ++++++++++++ 2 files changed, 22 insertions(+) (limited to 'ldap/admin/src/scripts') 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; -- cgit