Fix a Failing Open Directory

Applicable to OS X Server 10.7.5.

Fixing a Failing Open Directory

When a server running hangs and the machine is power cycled the Open Directory sometimes fails to restart. System reports (database “cn=authdata” cannot be opened, err 12).

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/

In Tool mode slapd  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

Next, turn Open Directory back on:

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

Finally, issue another restart:

$ sudo reboot

Open Directory is back up and running again.

Fixing Server Alerts when it fails

Applicable to OS X Server 10.7.5.

The Server Alerts logs can get corrupted and when it does will not be able to load it. CPU usage will increase and use a lot of the available resources. The processing ball  spins forever or sometimes ends with an “Error Reading” alert.

Server Alerts are logged by emond directly to the ASL events database, and are stored in /var/log/eventmonitor . Deleting the log will clear the problem.


sudo rm -rf /var/log/eventmonitor/*

to remove the events ASL database, then quit and re-open

A new events database is  recreated after deleting the contents of the eventmonitor folder and opening again.  Server Alerts  functions normally and logging resumes after clearing  the existing database files.