Mac OS X OpenDirectory Corruption

Mac OS X OpenDirectory Corruption

January 27th, 2011 // 9:23 am @

Had some issues with OpenDirectory a little while ago and thought I would publish the outcome so someone else can learn from what I found!

mkdir ~/ldap-rescue # create convenient directory
sudo slapcat -l ldif # create text file from slapd database
cd /var/db/openldap # move to openldap directory
sudo su
mv openldap-data openldap-data-old # srchive old data
mkdir openldap-data # new directory
chmod go-rx openldap-data # fix permissions, don’t know if needed.
/usr/libexec/slapd # test to see if slapd will run. This didn’t work before, with slapd exiting.
cat /var/run/slapd.pid # This resulted in a return value of 18691 on my system, so now slapd will run.
sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist
exit # get out of root. I’m dangerous.
cd ~/ldap_rescue # back to the rescue directory.
sudo slapadd -l ldif # reload the data. I’m lucky I got away with this.
sudo slapcat -l ldifnew # diff reports no differences in ldif and ldifnew
sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist


Category : Mac OS X Server

2 Comments → “Mac OS X OpenDirectory Corruption”


  1. mk

    7 years ago

    hi, i am running lion , could you tranfer a /System/Library/LaunchDaemons/org.openldap.slapd.plist file to me,


  2. AndrewP

    7 years ago

    < ?xml version="1.0" encoding="UTF-8"?>
    < !DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    Disabled

    HardResourceLimits

    NumberOfFiles
    8192

    Label
    org.openldap.slapd
    OnDemand

    Program
    /usr/libexec/slapd
    ProgramArguments

    /usr/libexec/slapd
    -d
    0
    -h
    ldap:/// ldapi://%2Fvar%2Frun%2Fldapi

    ServiceIPC

    SoftResourceLimits

    NumberOfFiles
    8192

    Umask
    63


Latest News

Certifications