187 lines
3.7 KiB
HTML
187 lines
3.7 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of RUNLEVEL</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>RUNLEVEL</H1>
|
|
Section: runlevel (8)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
runlevel - Print previous and current SysV runlevel
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>runlevel</B> [options...]
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>OVERVIEW</H2>
|
|
|
|
<P>
|
|
|
|
"Runlevels" are an obsolete way to start and stop groups of services used in SysV init. systemd provides a compatibility layer that maps runlevels to targets, and associated binaries like
|
|
<B>runlevel</B>. Nevertheless, only one runlevel can be "active" at a given time, while systemd can activate multiple targets concurrently, so the mapping to runlevels is confusing and only approximate. Runlevels should not be used in new code, and are mostly useful as a shorthand way to refer the matching systemd targets in kernel boot parameters.
|
|
<P>
|
|
|
|
|
|
|
|
<DD>
|
|
<B>Table 1. Mapping between runlevels and systemd targets</B>
|
|
|
|
<TABLE BORDER>
|
|
<TR VALIGN=top><TD><B>
|
|
<DD>Runlevel
|
|
</B></TD><TD><B>
|
|
Target
|
|
</B><BR></TD></TR>
|
|
<TR VALIGN=top><TD>
|
|
0
|
|
</TD><TD>
|
|
poweroff.target
|
|
<BR></TD></TR>
|
|
<TR VALIGN=top><TD>
|
|
1
|
|
</TD><TD>
|
|
rescue.target
|
|
<BR></TD></TR>
|
|
<TR VALIGN=top><TD>
|
|
2, 3, 4
|
|
</TD><TD>
|
|
multi-user.target
|
|
<BR></TD></TR>
|
|
<TR VALIGN=top><TD>
|
|
5
|
|
</TD><TD>
|
|
graphical.target
|
|
<BR></TD></TR>
|
|
<TR VALIGN=top><TD>
|
|
6
|
|
</TD><TD>
|
|
reboot.target
|
|
<BR></TD></TR>
|
|
</TABLE>
|
|
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<B>runlevel</B>
|
|
prints the previous and current SysV runlevel if they are known.
|
|
<P>
|
|
|
|
The two runlevel characters are separated by a single space character. If a runlevel cannot be determined, N is printed instead. If neither can be determined, the word "unknown" is printed.
|
|
<P>
|
|
|
|
Unless overridden in the environment, this will check the utmp database for recent runlevel changes.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<P>
|
|
|
|
The following option is understood:
|
|
<P>
|
|
|
|
<B>--help</B>
|
|
<DL COMPACT><DT id="2"><DD>
|
|
Print a short help text and exit.
|
|
</DL>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXIT STATUS</H2>
|
|
|
|
<P>
|
|
|
|
If one or both runlevels could be determined, 0 is returned, a non-zero failure code otherwise.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>ENVIRONMENT</H2>
|
|
|
|
<P>
|
|
|
|
<I>$RUNLEVEL</I>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
If
|
|
<I>$RUNLEVEL</I>
|
|
is set,
|
|
<B>runlevel</B>
|
|
will print this value as current runlevel and ignore utmp.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>$PREVLEVEL</I>
|
|
<DL COMPACT><DT id="4"><DD>
|
|
If
|
|
<I>$PREVLEVEL</I>
|
|
is set,
|
|
<B>runlevel</B>
|
|
will print this value as previous runlevel and ignore utmp.
|
|
</DL>
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<P>
|
|
|
|
/run/utmp
|
|
<DL COMPACT><DT id="5"><DD>
|
|
The utmp database
|
|
<B>runlevel</B>
|
|
reads the previous and current runlevel from.
|
|
</DL>
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?5+systemd.target">systemd.target</A></B>(5),
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemctl">systemctl</A></B>(1)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="8"><A HREF="#lbAD">OVERVIEW</A><DD>
|
|
<DT id="9"><A HREF="#lbAE">DESCRIPTION</A><DD>
|
|
<DT id="10"><A HREF="#lbAF">OPTIONS</A><DD>
|
|
<DT id="11"><A HREF="#lbAG">EXIT STATUS</A><DD>
|
|
<DT id="12"><A HREF="#lbAH">ENVIRONMENT</A><DD>
|
|
<DT id="13"><A HREF="#lbAI">FILES</A><DD>
|
|
<DT id="14"><A HREF="#lbAJ">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:15 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|