There can be times when you need to troubleshoot Directory Services in Mac OS X during system starts up. Directory Services apparently sits above and below the kernel — depending on what each of those components needs to do — so having debugging capability early on in the boot process can help you hone in on problems.
To enable debug logging at startup, run the following at the command line:
$ sudo touch /Library/Preferences/DirectoryService/.DSLogDebugAtStart
… and then, on the next restart, debug logging will be enabled. This is equivalent to running:
$ sudo killall -USR1 DirectoryService
… but the advantage is is that debug logging begins at startup, rather than whenever you can log in and start it manually.
Remove the file from the path above when you want to disable the logging for the subsequent restart. As a file whose name starts with a dot, you won’t see it listed by default in the Finder. (The Finder hides dot files by default.)
$ sudo rm /Library/Preferences/DirectoryService/.DSLogDebugAtStart
For more details, see the Apple article on Mac OS X Server v10.5, 10.6: Enabling Directory Service debug logging. (Note that directory service logging works on the workstation version of Mac OS X, not just Mac OS X Server.)