]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/runlevel.xml
man: revert dynamic paths for split-usr setups
[thirdparty/systemd.git] / man / runlevel.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 This file is part of systemd.
7
8 Copyright 2010 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="runlevel"
25 xmlns:xi="http://www.w3.org/2001/XInclude"
26 conditional="HAVE_UTMP">
27
28 <refentryinfo>
29 <title>runlevel</title>
30 <productname>systemd</productname>
31
32 <authorgroup>
33 <author>
34 <contrib>Developer</contrib>
35 <firstname>Lennart</firstname>
36 <surname>Poettering</surname>
37 <email>lennart@poettering.net</email>
38 </author>
39 </authorgroup>
40 </refentryinfo>
41
42 <refmeta>
43 <refentrytitle>runlevel</refentrytitle>
44 <manvolnum>8</manvolnum>
45 </refmeta>
46
47 <refnamediv>
48 <refname>runlevel</refname>
49 <refpurpose>Print previous and current SysV runlevel</refpurpose>
50 </refnamediv>
51
52 <refsynopsisdiv>
53 <cmdsynopsis>
54 <command>runlevel <arg choice="opt" rep="repeat">options</arg></command>
55 </cmdsynopsis>
56 </refsynopsisdiv>
57
58 <refsect1>
59 <title>Description</title>
60
61 <para><command>runlevel</command> prints the previous and current
62 SysV runlevel if they are known.</para>
63
64 <para>The two runlevel characters are separated by a single space
65 character. If a runlevel cannot be determined, N is printed
66 instead. If neither can be determined, the word "unknown" is
67 printed.</para>
68
69 <para>Unless overridden in the environment, this will check the
70 utmp database for recent runlevel changes.</para>
71 </refsect1>
72
73 <refsect1>
74 <title>Options</title>
75
76 <para>The following option is understood:</para>
77
78 <variablelist>
79 <varlistentry>
80 <term><option>--help</option></term>
81
82 <xi:include href="standard-options.xml" xpointer="help-text" />
83 </varlistentry>
84 </variablelist>
85
86 </refsect1>
87
88 <refsect1>
89 <title>Exit status</title>
90
91 <para>If one or both runlevels could be determined, 0 is returned,
92 a non-zero failure code otherwise.</para>
93
94 </refsect1>
95
96 <refsect1>
97 <title>Environment</title>
98
99 <variablelist class='environment-variables'>
100 <varlistentry>
101 <term><varname>$RUNLEVEL</varname></term>
102
103 <listitem><para>If <varname>$RUNLEVEL</varname> is set,
104 <command>runlevel</command> will print this value as current
105 runlevel and ignore utmp.</para></listitem>
106 </varlistentry>
107
108 <varlistentry>
109 <term><varname>$PREVLEVEL</varname></term>
110
111 <listitem><para>If <varname>$PREVLEVEL</varname> is set,
112 <command>runlevel</command> will print this value as previous
113 runlevel and ignore utmp.</para></listitem>
114 </varlistentry>
115 </variablelist>
116 </refsect1>
117
118 <refsect1>
119 <title>Files</title>
120
121 <variablelist>
122 <varlistentry>
123 <term><filename>/var/run/utmp</filename></term>
124
125 <listitem><para>The utmp database <command>runlevel</command>
126 reads the previous and current runlevel
127 from.</para></listitem>
128 </varlistentry>
129 </variablelist>
130 </refsect1>
131
132 <refsect1>
133 <title>Notes</title>
134
135 <para>This is a legacy command available for compatibility only.
136 It should not be used anymore, as the concept of runlevels is
137 obsolete.</para>
138 </refsect1>
139
140 <refsect1>
141 <title>See Also</title>
142 <para>
143 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
144 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
145 </para>
146 </refsect1>
147
148 </refentry>