1 <html><head><meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8"><title>runlevel
</title><meta name=
"generator" content=
"DocBook XSL Stylesheets V1.78.1"></head><body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF"><style>
11 background-color: #c60f0f;
15 h1:hover
> a.headerlink, h2:hover
> a.headerlink, h3:hover
> a.headerlink, dt:hover
> a.headerlink {
18 </style><a href=
"index.html">Index
</a>·
19 <a href=
"systemd.directives.html">Directives
</a>·
20 <a href=
"../python-systemd/index.html">Python
</a>·
21 <a href=
"../libudev/index.html">libudev
</a>·
22 <a href=
"../libudev/index.html">gudev
</a><span style=
"float:right">systemd
217</span><hr><div class=
"refentry"><a name=
"runlevel"></a><div class=
"titlepage"></div><div class=
"refnamediv"><h2>Name
</h2><p>runlevel — Print previous and current SysV runlevel
</p></div><div class=
"refsynopsisdiv"><h2>Synopsis
</h2><div class=
"cmdsynopsis"><p><code class=
"command">runlevel [options...]
</code> </p></div></div><div class=
"refsect1"><a name=
"idm214169516464"></a><h2 id=
"Description">Description
<a class=
"headerlink" title=
"Permalink to this headline" href=
"#Description">¶
</a></h2><p><span class=
"command"><strong>runlevel
</strong></span> prints the previous
23 and current SysV runlevel if they are known.
</p><p>The two runlevel characters are separated by a
24 single space character. If a runlevel cannot be
25 determined, N is printed instead. If neither can be
26 determined, the word
"unknown" is printed.
</p><p>Unless overridden in the environment, this will
27 check the utmp database for recent runlevel
28 changes.
</p></div><div class=
"refsect1"><a name=
"idm214169513552"></a><h2 id=
"Options">Options
<a class=
"headerlink" title=
"Permalink to this headline" href=
"#Options">¶
</a></h2><p>The following option is understood:
</p><div class=
"variablelist"><dl class=
"variablelist"><dt id=
"--help"><span class=
"term"><code class=
"option">--help
</code></span><a class=
"headerlink" title=
"Permalink to this term" href=
"#--help">¶
</a></dt><dd><p><a name=
"help-text"></a>Print a short help text and exit.
29 </p></dd></dl></div></div><div class=
"refsect1"><a name=
"idm214169510160"></a><h2 id=
"Exit status">Exit status
<a class=
"headerlink" title=
"Permalink to this headline" href=
"#Exit%20status">¶
</a></h2><p>If one or both runlevels could be determined,
0
30 is returned, a non-zero failure code otherwise.
</p></div><div class=
"refsect1"><a name=
"idm214169508848"></a><h2 id=
"Environment">Environment
<a class=
"headerlink" title=
"Permalink to this headline" href=
"#Environment">¶
</a></h2><div class=
"variablelist"><dl class=
"variablelist"><dt id=
"$RUNLEVEL"><span class=
"term"><code class=
"varname">$RUNLEVEL
</code></span><a class=
"headerlink" title=
"Permalink to this term" href=
"#%24RUNLEVEL">¶
</a></dt><dd><p>If
31 <code class=
"varname">$RUNLEVEL
</code> is set,
32 <span class=
"command"><strong>runlevel
</strong></span> will print
33 this value as current runlevel and
34 ignore utmp.
</p></dd><dt id=
"$PREVLEVEL"><span class=
"term"><code class=
"varname">$PREVLEVEL
</code></span><a class=
"headerlink" title=
"Permalink to this term" href=
"#%24PREVLEVEL">¶
</a></dt><dd><p>If
35 <code class=
"varname">$PREVLEVEL
</code> is set,
36 <span class=
"command"><strong>runlevel
</strong></span> will print
37 this value as previous runlevel and
38 ignore utmp.
</p></dd></dl></div></div><div class=
"refsect1"><a name=
"idm214173401872"></a><h2 id=
"Files">Files
<a class=
"headerlink" title=
"Permalink to this headline" href=
"#Files">¶
</a></h2><div class=
"variablelist"><dl class=
"variablelist"><dt id=
"/var/run/utmp"><span class=
"term"><code class=
"filename">/var/run/utmp
</code></span><a class=
"headerlink" title=
"Permalink to this term" href=
"#/var/run/utmp">¶
</a></dt><dd><p>The utmp database
39 <span class=
"command"><strong>runlevel
</strong></span> reads the
40 previous and current runlevel
41 from.
</p></dd></dl></div></div><div class=
"refsect1"><a name=
"idm214173398160"></a><h2 id=
"Notes">Notes
<a class=
"headerlink" title=
"Permalink to this headline" href=
"#Notes">¶
</a></h2><p>This is a legacy command available for compatibility
42 only. It should not be used anymore, as the concept of
43 runlevels is obsolete.
</p></div><div class=
"refsect1"><a name=
"idm214173396800"></a><h2 id=
"See Also">See Also
<a class=
"headerlink" title=
"Permalink to this headline" href=
"#See%20Also">¶
</a></h2><p>
44 <a href=
"systemd.html"><span class=
"citerefentry"><span class=
"refentrytitle">systemd
</span>(
1)
</span></a>,
45 <a href=
"systemctl.html"><span class=
"citerefentry"><span class=
"refentrytitle">systemctl
</span>(
1)
</span></a>
46 </p></div></div></body></html>