From this Apple article, I want to examine this /var/root/Library/Preferences/com.apple.loginwindow file. Any suggestion how to do this?
3 Answers
In terminal
# sudo defaults read com.apple.loginwindow LoginHook
-
I got this message: "The domain/default pair of (com.apple.loginwindow, LoginHook) does not exist". Does it mean there is no login hook script?– EmilyJFeb 17, 2014 at 16:52
-
-
I should clarify that there is no root-level LoginHook currently set. You can set it by typing
sudo defaults write com.apple.loginwindow LoginHook /path/to/command
Feb 18, 2014 at 15:21
You can easily navigate to the directory in question ("/var/root/Library/Preferences/") from your terminal by first using: sudo su root
(you will be prompted for your password by the sudo command).
While the cut and paste answer derived from the article you read is correct.. it is there in that document you read, it doesn't show you the specific file you're after. If you want to actually assign a start-up script, one (though much more technical doc about this you might have a look at is: Apple Developer's Documentation on System Start-up Daemon's and Services, which makes the very important provision for the sudo defaults read com.apple.loginwindow LoginHook
command:
Note: If no plist file exists for com.apple.loginwindow, this method will not work. This file (/var/root/Library/Preferences/com.apple.loginwindow.plist) does not exist on a fresh installation until the user changes a login window setting (such as turning on fast user switching).
So, you should first have a look and see if that file exists on your machine, if not, that my be part of your problem. You can do this as stated above by creating or using your "root" user, to see whether or not you have the required "plist" file from above.
You can check to see the status of com.apple.loginwindow using: defaults read com.apple.loginwindow
--note that you may need to proceed that with "sudo".
If the above information does not help, I think giving some more specific information on what you've tried, and the results you've gotten would help further narrowing things down for you.
Hope this helped.
-
Thank you for a super detail answer. Since I can only select one response to be my answer, I selected the other one just because it got here first and it did answer my question. I will come back to upvote your answer when I have earned enough reputation to allow me to do so.– EmilyJFeb 20, 2014 at 22:17
-
No worries, Emily. The important thing is that you got your problem resolved. If the other post resolved it for you without the extra detail, they should get the selection. =) Feb 22, 2014 at 3:32
- ctrl-escape (or cmd-escape) to run spotlight.
- Type console
- Search for loginwindow