The options for Open Directory continue to get more refined, aligning with opendirectoryd. The odutil command is becoming more and more useful with each version of OS X. Let’s inspect the directory service cache, using odutil with the show verb and the cache option:
odutil show cache
You can also view statistics for opendirectoryd using that show verb but with the statistics option:
odutil show statistics
And to see everything, use odutil with the show verb and the all option to get plenty of data to grep through:
odutil show all
The final show option we’ll look at is configuration. Here, you will also need to feed a directory nodename into the command:
odutil show configuration /Search
Now, /Search is a node but there are a lot. You can use show with nodes to see a listing of all the nodes:
odutil show nodes
You can then see which pids have references to opendirectoryd as well as the nodenames, reference IDs, and session IDs.
All of this can be very helpful when troubleshooting Open Directory issues. One thing I find I do pretty frequently is resetting statistics then repeating a process that is causing a problem so I can view only the updated statistics. To do so:
odutil reset statistics
You can also disable statistics (I’ve seen them create performance concerns:
odutil set statistics off
Or to turn them back on:
odutil set statistics on
Once upon a time you could killall DirectoryService with a -usr level to set various logging levels. With opendirectoryd, we can still do that, but it’s less cludgy with odutil. Here, we’ll set the logging level as detailed as we can get:
odutil set log debug
Other levels, in ascending order of verbosity, include alert, critical, error, warning, notice, and info.