Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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).

share|improve this question
    
You do realize that it's not exactly possible to provide an answer that is guaranteed to work in 10.8+? –  Daniel Beck Dec 6 '11 at 19:05
    
Fair enough, at least for 10.6 and 10.7 hopefully an answer can be found. I have edited the question to remove that element. Thanks for pointing it out. –  John Dec 6 '11 at 19:13
    
TN2228 (from mid 2008) states: This technote only discusses login; it does not cover issues related to logout. Specifically, while the authorization plug-in technique described in this technote is a good alternative for the login hook, there is currently no equivalent replacement for the logout hook, referencing the Radar (Apple Bug Database) issue 4905756. You could try to contact Apple developer support and inquire about that issue's status. –  Daniel Beck Dec 6 '11 at 19:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.