[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Emergency--Major LDAP breakage...more info



if you are able to do a slapcat, and save any of your ldap currently,
I have a script, that will take out all of the conflicting lines, so that you can use:
ldapadd -x -h localhost -D "cn=manager,dc=IDEALX,dc=ORG" -f base.ldif -W
(only replacing with your info)


this will regenerate the ldap database from scratch

1) stop ldap
2) slapcat -f /etc/openldap/slapd.conf -l /root/ldapbackup.10.9.2003.ldif
3) use this script on that ldif file(I name it convertldif)
#####################################################
#! /bin/sh
#this script will convert a slapcat ldif backup into a format ready to be added with ldapadd
echo "Enter in the backup ldif file name:"
read file
echo "What do you want to name your converted ldif?(leave off .ldif):"
read newfile
cat $file|while read line; do
if [ -n "$(echo $line|grep "structuralObjectClass:")" ] ; then
echo " Deleting line:"
echo $line
elif [ -n "$(echo $line|grep "entryUUID:")" ] ; then
echo " Deleting line:"
echo $line
elif [ -n "$(echo $line|grep "creatorsName:")" ] ; then
echo " Deleting line:"
echo $line
elif [ -n "$(echo $line|grep "createTimestamp:")" ] ; then
echo " Deleting line:"
echo $line
elif [ -n "$(echo $line|grep "entryCSN:")" ] ; then
echo " Deleting line:"
echo $line
elif [ -n "$(echo $line|grep "modifiersName:")" ] ; then
echo " Deleting line:"
echo $line
elif [ -n "$(echo $line|grep "modifyTimestamp:")" ] ; then
echo " Deleting line:"
echo $line
else
echo $line >> $newfile.ldif
fi
done
#################################
4)ldapadd -x -h localhost -D "cn=manager,dc=IDEALX,dc=ORG" -f /root/converted.ldif -W
(replace with your info)


I've had to do this a couple of times...

if anyone knows of a way to make this run faster....let me know...
it may take a while depending on your system speed

Barry Smoke
District Network Admin
Bryant Public Schools
Bryant, AR





Les Mikesell wrote:

On Wed, 2003-10-08 at 10:46, David Trask wrote:



Oct 8 11:20:44 spongebob slapd[3391]: ldbm: ==> page 305: illegal page
type or format



Your dbm file holding the database is corrupt. Dbm's are odd beasts - unix filesystems let you seek long distances into a file and write without allocating the intermediate space so for fast access you hash the database key to a number and seek that far into the file to store it (collision logic omitted...). Your best bet is to restore a from backup or rebuild from the ldif if you exported one recently.

---
  Les Mikesell
    les futuresource com


_______________________________________________
K12OSN mailing list
K12OSN redhat com
https://www.redhat.com/mailman/listinfo/k12osn
For more info see <http://www.k12os.org>







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]