The init process now writes the current runlevel to /var/run/runlevel.

This information can be read by the "runlevel" command as well as "halt"
and "reboot". Having the information logged in /var/run/runlevel as
well as the utmp file means systems without utmp (like those running
the musl C library) can still check the current runlevel. This is
useful when running halt/reboot as these programs want to check the
runlevel.

Updated the changelog, and manual pages for halt and runlevel.
This commit is contained in:
Jesse Smith
2018-07-07 20:19:03 -03:00
parent 6b26692584
commit 6e8323e9fb
8 changed files with 37 additions and 14 deletions

View File

@@ -95,7 +95,8 @@ never be called directly. From release 2.74 on \fBhalt\fP and \fBreboot\fP
invoke \fBshutdown\fP(8) if the system is not in runlevel 0 or 6. This
means that if \fBhalt\fP or \fBreboot\fP cannot find out the current
runlevel (for example, when \fI/var/run/utmp\fP hasn't been initialized
correctly) \fBshutdown\fP will be called, which might not be what you want.
correctly and /var/run/runlevel does not exist) \fBshutdown\fP will be called,
which might not be what you want.
Use the \fB-f\fP flag if you want to do a hard \fBhalt\fP or \fBreboot\fP.
.PP
The \fB-h\fP flag puts all hard disks in standby mode just before halt

View File

@@ -34,7 +34,9 @@ runlevel, the letter \fBN\fP will be printed instead.
.PP
If no
.I utmp
file exists, or if no runlevel record can be found,
file exists, and if no runlevel record can be found in the
.I /var/run/runlevel
file,
.B runlevel
prints the word \fBunknown\fP and exits with an error.
.PP