macOS "who -a" command strange output

So I was running the who -a command on my Mac and normally I see the reboot user and my user in the output. However, this time the output is a little different, and I see:

.       run-level 3

Is this normal output for the command or is this something weird?


Solution 1:

It's normal, but in an odd sort of way :)

Reviewing man who in my macOS Catalina, we see that:

     Available options:  

     -a    Same as -bdlprTtu 

     ...

     -r    Print the current runlevel.  This is meaningless on Mac OS X.  

... 

BSD                            January 17, 2007

I can't explain why you've never noticed the runlevel output before, but it's always been part of the output with the -a option. Also, you can see that the manual for who was last updated nearly 15 years ago: January 17, 2007 on my system.

The reason that runlevel was meaningless on Mac OS X, and is still meaningless today is that macOS & its predecessors have for years used launchd in lieu of the init system; init has run levels, but launchd does not.

You may wonder, "If who reports run level, and macOS systems do not have run levels, why is it included in macOS?" Or, "Why doesn't Apple modify the code to eliminate that confusion?"

Only Apple can answer those questions. However, from the historical record, we know Apple chose to use Darwin in their systems since ca. Steve Jobs' return to Apple, and we know that Darwin is built partly on the Unix BSD code base. That doesn't even begin to answer why the code remains essentially un-modified over all these years, but at least it explains how it got there in the first place.