View Full Version : 10.6.1 Login Hooks
Oct 13, 2009, 04:02 PM
I'm working in a corporate enviornment and am attempting to use Login Hooks in all of my Mac images. Previously with 10.5.8 I was successfully able to use login hooks according to apples article by writing to the com.apple.loginwindow to add it. Since 10.6 has been released I've been unable to use the login hook following the exact same instructions. Apple has told me they cannot help me as their support doesn't cover going this deep into customization of the os. Any help in getting my login hook to execute would be greatly appreciated as I'd like to get my 10.6.1 image up to par.
Oct 13, 2009, 08:57 PM
I can tell you that it still works just as it did before. And your description of the problem is really, really thin (honestly it is not enough to warrant a response). The usual suspects in cases like this:
1) "The script works when I try it in the terminal" - this usually means that there is something about your environment (usually the PATH variable) that is making it work in your login that is not present in the root context that is called by the loginwindow process.
2) A permissions issue with the script. (not making it executable, or placing it in a directory that root does not have read access to)
3) You are using Managed Client and have not allowed computer loginhooks
4) You have placed the loginhook trigger into /Library/Preferences/com.apple.loginwindow.plist rather than /private/var/root/Library/Preferences/com.apple.loginwindow.plist.
5) Typo errors. They are really tough to catch in these cases.
I can assure you that others have this working with no changes from 10.5. It is something that you are doing wrong, and not a system change.
Oct 14, 2009, 11:51 AM
Sorry, I should have been more specific with my situation. I am using login hooks with a compiled applescript application. I have tired both of the ways apple suggests in their help article which I believe is HT2420. The way I did it in snow leopard was using terminal, switching to root, and issuing the command:
defaults write com.apple.loginwindow LoginHook /Bind.app
But I've also tried the other way apple specified by editing the /etc/ttys as well and it had no effect as well. Note I have changed absolutely nothing since my leopard installs with the way I do this. On a side note though apple's help article states that when you issue the above command it writes to /var/root/Library/Preferences/com.apple.loginwindow.plist instead of he same path but in the /private directory as you stated. Not sure if that makes a difference, but as I've said this all worked in my leopard install.
Oct 15, 2009, 01:10 PM
Resolved the issue. The issue resided in the AppleScript Editor. It has a bug when compiling a Run Only application. It does not create it as run only, instead it is a packaged application, therefore causing it not to allow execution through loginhooks. I recompiled the script in leopard and am successfully able to use it in snow leopard.