Max OS X includes command-line tools that are useful in confirming that DirectoryService is responding to requests and that those requests contain correct information. As you saw earlier, you can use dscl to find out how DirectoryService responds to requests. This tool will retrieve information from any of the DirectoryService plug-ins. When troubleshooting, it may be necessary for you to view or edit the contents of your data stores. Again, you can use Workgroup Manager or dscl to view and modify the local NetInfo database, and you can use any text editor to view and modify the BDS flat files (located in the /etc directory), which are all owned by root. You will follow a basic workflow to solve directory-service issues. For example, suppose you are unable to log in using an account that you set up in either the local NetInfo database or in the BDS flat files. Take these general steps to resolve the issue:
Using the DirectoryService Debug LogAnother good resource for looking at DirectoryService activity is the DirectoryService debug log. To enable the log, go to Terminal and type sudo killall -USR1 DirectoryService. Once the log is enabled, you can use Console to view the results. With Console, you can filter local logs by command, error codes, or anything that is contained in the log. You can also clear the screen or add flags to track new entries. If you need to locate information in the debug logs of remote computers (using ssh, for example), you can use the command-line utilities tail and grep to filter information found in /Library/Logs/ DirectoryService/DirectoryService.debug.log. The debug log will continue to log information until disabled. To disable the log, use the same command you used to enable it. You can also use the following command to turn on API logging: sudo killall -USR2 DirectoryService The result is that any calls to the API will be logged in the /var/log/system.log. The USR2 logging will automatically turn itself off after 5 minutes. More Info The man pages for DirectoryService provide a list of error codes that you may see in the log files. You can also log DirectoryService activity at startup by creating two files:
When DirectoryService detects these files at startup, log entries will be added to them. This is useful in evaluating what the computer is doing when it boots. Enabling the DirectoryService Debug LogBy default, the DirectoryService debug log is not enabled. Use Terminal to enable the debug log on the DirectoryService process:
Viewing and Marking Logs With ConsoleYou can use Console to view and mark the debug log to track events that take place in the Finder:
|