Posted on 11-07-2014 11:06 AM
In troubleshooting a few script issues, I discovered that /dev/console is now showing ownership as root instead of the logged on user. Has anyone else seen this?
Posted on 11-07-2014 11:16 AM
Which OS version? I haven't seen that, but would be very interested to know more since we have a boatload of scripts that use that to determine the logged in user.
Posted on 11-07-2014 12:13 PM
Seems to be all 10.9.5. Inconsistent results though. My 10.9.5 Macbook is showing my ID as owner of /dev/console, but I definitely see root on a login script in the logs on other machines. I had to change the script to use $3.
Posted on 11-07-2014 12:29 PM
Could be a timing thing. Root will own console when no-one is logged in, but switches ownership to the logged in user once login is done. If the script is firing too soon, it may still be seeing root as the owner of console.
Maybe place a small delay (1 second) to the script right up front so it waits until the user is fully logged in before it tries to figure out the console owner.
Posted on 01-04-2015 03:36 AM