diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2010-09-13 10:34:11 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-09-13 10:34:11 -0700 |
commit | 16462b234630b7fc33f051bbb644baf4be313c63 (patch) | |
tree | d0afafdf627d572633507f4420e54323f53a0f65 /ldap/admin | |
parent | 80ce631a97977c273a56b5d4d7e99a7eaf109d57 (diff) | |
download | ds-16462b234630b7fc33f051bbb644baf4be313c63.tar.gz ds-16462b234630b7fc33f051bbb644baf4be313c63.tar.xz ds-16462b234630b7fc33f051bbb644baf4be313c63.zip |
Bug 633168 - Share backend dbEnv with the replication changelog
https://bugzilla.redhat.com/show_bug.cgi?id=633168
Description: previous commit was missing the upgrade script 81changelog.pl
Diffstat (limited to 'ldap/admin')
-rw-r--r-- | ldap/admin/src/scripts/81changelog.pl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ldap/admin/src/scripts/81changelog.pl b/ldap/admin/src/scripts/81changelog.pl new file mode 100644 index 00000000..f0fff1bb --- /dev/null +++ b/ldap/admin/src/scripts/81changelog.pl @@ -0,0 +1,29 @@ +use Mozilla::LDAP::Conn; + +# Cleanup local changelog db +# If changelog db exists, run db_checkpoint to flush the transaction logs. +# Then, remove the local region files and transaction logs. +sub runinst { + my ($inf, $inst, $dseldif, $conn) = @_; + + my @errs; + + my $config = "cn=changelog5,cn=config"; + my $config_entry = $conn->search($config, "base", "(cn=*)"); + if (!$config_entry) { + # cn=changelog5 does not exist; not a master. + return (); + } + # First, check if the server is up or down. + my $changelogdir = $config_entry->getValues('nsslapd-changelogdir'); + + # Run db_checkpoint + system("/usr/bin/db_checkpoint -h $changelogdir -1"); + + # Remove old db region files and transaction logs + system("rm $changelogdir/__db.*"); + system("rm $changelogdir/log.*"); + system("rm $changelogdir/guardian"); + + return (); +} |