/dev/console now showing ownership as root

luke_j_nelson
New Contributor II

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?

4 REPLIES 4

mm2270
Legendary Contributor III

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.

luke_j_nelson
New Contributor II

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.

mm2270
Legendary Contributor III

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.

bentoms
Release Candidate Programs Tester