logout hooks for dummies
I found several recipes on the web all suggesting modifying the loginwindow plist but none of this has worked for me.
PowerBook G4 17'', 1.5GHz, Mac OS X (10.5.2), Mac Pro 2.66GHz, Mac Pro 3.2GHz
PowerBook G4 17'', 1.5GHz, Mac OS X (10.5.2), Mac Pro 2.66GHz, Mac Pro 3.2GHz
biovizier wrote:
Actually, the method of configuring "logout hooks" depends on the OS X version - Apple keeps moving it around so a method for one version may not work on another.
Since 10.4, the login window hooks go in the "com.apple.loginwindow.plist" file in the "root" account's "Preferences" folder (i.e. "/private/var/root/Library/Preferences"). The property name is ' LoginHook' or ' LogoutHook" respectively for the two types (both are case-sensitive), and the value should be the full path to the script.
Using the ' defaults' command as "root" is probably the easiest way to set them up, as in:<pre>
sudo /usr/bin/defaults write com.apple.loginwindow LogoutHook /path/to/script</pre>
http://docs.info.apple.com/article.html?artnum=301446
Note that loginwindow hooks run as "root" so the script should be stored in a location such that its entire path is write protected against anyone other than "root". It is also probably a good idea to make sure the script works correctly in "Terminal.app" before letting it run as "root" automatically as a hook.
logout hooks for dummies