Skip to main content
Question

/dev/console now showing ownership as root

  • November 7, 2014
  • 4 replies
  • 26 views

Forum|alt.badge.img+5

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

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • November 7, 2014

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.


Forum|alt.badge.img+5
  • Author
  • Contributor
  • November 7, 2014

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
Forum|alt.badge.img+24
  • Legendary Contributor
  • November 7, 2014

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
Forum|alt.badge.img+35
  • Hall of Fame
  • January 4, 2015