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

  • 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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.