Today I pushed new code to the git "2.91" branch which makes init (and its associated tools) write the current runlevel to a log file (/var/run/runlevel). Having this information here, as well as in utmp, lets us check/confirm the current runlevel on systems that do not support utmp. This should come in handy on platforms like FreeBSD and Linux distros that use the musl C library.
That's the theory anyway. :) I have tested it on my own machines by booting and then deleting the /var/run/utmp file to confirm the halt, reboot and runlevel tools could still properly detect the current runlevel. So far the change is working for me and I'm no longer getting errors from halt/reboot when utmp does not exist. I'd like to get feedback on whether this change is working for others. I had to update our Makefile a bit with the new code and want to make sure nothing got broken in the process. - Jesse