Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

A Mac OS X Lion 10.7.5 server running Open Directory hung. SSH was still possible but the sudo reboot command didn't restart the server within 15 minutes. That is why a power cycle was issued. After the power cycle Open Directory would no longer start and the System log is filled with a new message every 10 seconds:

com.apple.launchd[1] (org.openldap.slapd[1153]): Exited with code: 1
com.apple.launchd[1] (org.openldap.slapd): Throttling respawn: Will start in 10 seconds

Repairing disk permission, neither another reboot doesn't solve the issue.

Slapd in Tool mode outputs:

$ sudo /usr/libexec/slapd -Tt
bdb(dc=nl2,dc=probackup,dc=nl): unable to allocate memory for mutex; resize mutex region
bdb_db_open: database "dc=nl2,dc=probackup,dc=nl" cannot be opened, err 12. Restore from backup!
backend_startup_one (type=bdb, suffix="dc=nl2,dc=probackup,dc=nl"): bi_db_open failed! (12)
slap_startup failed (test would succeed using the -u switch)

How to fix this?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

To repair the Open Directory authdata database:

$ sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist
$ sudo db_recover -h /var/db/openldap/authdata/

Now slapd in tool mode outputs:

$ sudo /usr/libexec/slapd -Tt
bdb_db_open: database "dc=nl2,dc=probackup,dc=nl": unclean shutdown detected; attempting recovery.
bdb_db_open: database "dc=nl2,dc=probackup,dc=nl": recovery skipped in read-only mode. Run manual recovery if errors are encountered.
bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
config file testing succeeded

Now turn back on Open Directory:

$ sudo launchctl load /System/Library/LaunchDaemons/org.openldap.slapd.plist

And issue another restart to be better safe than sorry:

$ sudo reboot

Open Directory is now up and running again.

share|improve this answer

First best is to check the disk you may do so either using the recovery partition or single user (cmd - S at startup) then type :

fsck -fy

QWERTY keyboard the dash is 2 key left from backspace.

To re-import a corrupted database from a backup you should backup and replace the following files/ folders :

  • var/db/openldap/
  • usr/bin/db_recover

Not sure it's necessary but if you have removed the LDAPv3 entry in the System keychain :

  • Library/Keychains/System.keychain

The try a recovery…

Then you should repair disk permissions from a terminal (not single user) :

diskutil repairPermissions /

If after the recovery you experience problem connecting to services check the configuration under "Services" tab in Directory Utility.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.