LDAP is dead need help!

Our Xserve raid locked up over the weekend, restarted the server and all seemed well. today I found the LDAP server is not working. I believe it may have happened when the server was restarted.


log is giving me this:
Aug 13 10:04:51 xserve2 slapd[1264]: bdb(dc=xserve2,dc=macomber,dc=com): PANIC: fatal region error detected; run recovery
Aug 13 10:04:51 xserve2 slapd[1264]: bdb dbopen: Database cannot be opened, err -30978. Restore from backup!
Aug 13 10:04:51 xserve2 slapd[1264]: bdb(dc=xserve2,dc=macomber,dc=com): DB ENV->lock_idfree interface requires an environment configured for the locking subsystem
Aug 13 10:04:51 xserve2 slapd[1264]: bdb(dc=xserve2,dc=macomber,dc=com): txn_checkpoint interface requires an environment configured for the transaction subsystem
Aug 13 10:04:51 xserve2 slapd[1264]: bdb dbclose: txn_checkpoint failed: Invalid argument (22)
Aug 13 10:04:51 xserve2 slapd[1264]: backend startupone: bi dbopen failed! (-30978)
Aug 13 10:04:51 xserve2 slapd[1264]: bdb dbclose: alock_close failed
Aug 13 10:04:51 xserve2 slapd[1264]: slapd stopped.
Aug 13 10:04:51 xserve2 slapd[1264]: connections_destroy: nothing to destroy.

Xserve G5, Mac OS X (10.5.4)

Posted on Aug 13, 2008 7:13 AM

Reply
6 replies

Aug 29, 2008 6:10 PM in response to pjstroud

The answer is there in the log output:

"Database cannot be opened, err -30978. Restore from backup!"

That's going to be your best bet. Restore from your most recent of your routine backups prior to the outage.

Otherwise, explore db_recover, but I've not attempted this on OS X Server, and at that point,
you're trying to automagically recover something already known-damaged. The (restored) backup will be a better long-term investment.

Aug 29, 2008 8:25 PM in response to davidh

As for backing up OD, well...

See
http://www.google.com/search?q=OpenDirectorybackup
the afp548.com article is a good reference (script from Joel Rennich) but is geared towards 10.3 (probably works for 10.4) but, also look at the "Anonymous" reply there (another script),
which I believe (not 100 % sure) was Michael Bartosh (RIP) - author of the invaluable
http://oreilly.com/catalog/9780596006358/

which does not attempt to stop slapd. Besides, 10.5 does not use SystemStarter for slapd,
that is handled now by launchd. Ideally, yes, you want to make sure you stop slapd
to ensure the consistency of the backup. You'll have to adjust and use launchctl then.

When you use the GUI in 10.4 (I've not had a chance to monitor this same process in 10.5) to do a backup via Server Admin, the initial steps it actually takes are as follows:

1 Backing up LDAP database
slapconfig -backupdb
/usr/sbin/slapcat -l /tmp/slapconfig backupstage/backup.ldif
/bin/cp -r /etc/openldap /tmp/slapconfig backupstage/

2 Backing up password server database

/usr/sbin/mkpassdb -backupdb /tmp/slapconfig backup_stage/passwordserverbackup/ > /dev/null
/bin/hostname > /tmp/slapconfig backupstage/hostname
/usr/sbin/sso_util info -pr /LDAPv3/127.0.0.1 > /tmp/slapconfig backup_stage/localkrb5realm

3 Backing up Kerberos database

/usr/sbin/mkpassdb -list > /tmp/slapconfig backupstage/sasl-plugin-list
/usr/sbin/kdb5_util dump > /tmp/slapconfig backupstage/kdb5dump.bak

(err, BAD line-wraps, let me try to fix this):

4 Backing up configuration files
/usr/bin/tar czpf /tmp/slapconfigbackupstage/krb5backup.tar.gz /var/db/krb5kdc/kdc.conf /var/db/krb5kdc/kadm5.acl /var/db/krb5kdc/kadm5.keytab /var/db/krb5kdc/.k5.* /Library/Preferences/edu.mit.Kerberos /etc/krb5.keytab


/bin/cp /System/Library/LaunchDaemons/com.apple.PasswordService.xml /tmp/slapconfig backupstage/LaunchDaemons/

/bin/cp /System/Library/LaunchDaemons/org.openldap.slapd.xml /tmp/slapconfig backupstage/LaunchDaemons/





More here:

http://www.afp548.com/article.php?story=20050615173039158

http://www.barbariangroup.com/posts/840-migratingusers_from_a_tiger_server_to_a_clean_leopardserver

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

LDAP is dead need help!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.