I am working on a project where I need to implement a logout script on some Macintosh computers. I have read the following Create a logoff script/task for Mac OS X article and found that while it is helpful, I am not sure it addresses my needs. We use login scripts by way of a .sh file that is called from a plist LaunchAgent. I was curious if there was a way to create a plist file that could call a logout.sh file in the same manner (i.e. from Launchd).
The methods of using the com.apple.loginwindow LogoutHook seem to be more hackish (and super deprecated) than anything. I also have concerns about how long Apple will support or allow this method to be used since it has been around since 10.2. The logout script will need to work on OS X 10.6 (Snow Leopard) and 10.7 (Lion).