]>
Commit | Line | Data |
---|---|---|
359957ee LP |
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 | |
5430f7f2 LP |
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 | |
359957ee LP |
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 | |
5430f7f2 | 18 | Lesser General Public License for more details. |
359957ee | 19 | |
5430f7f2 | 20 | You should have received a copy of the GNU Lesser General Public License |
359957ee LP |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
22 | --> | |
23 | ||
dfdebb1b | 24 | <refentry id="runlevel" |
37161c51 ERB |
25 | xmlns:xi="http://www.w3.org/2001/XInclude" |
26 | conditional="HAVE_UTMP"> | |
359957ee LP |
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 | |
62 | and current SysV runlevel if they are known.</para> | |
63 | ||
96d4ce01 | 64 | <para>The two runlevel characters are separated by a |
359957ee | 65 | single space character. If a runlevel cannot be |
af62c704 KS |
66 | determined, N is printed instead. If neither can be |
67 | determined, the word "unknown" is printed.</para> | |
359957ee | 68 | |
af62c704 | 69 | <para>Unless overridden in the environment, this will |
359957ee LP |
70 | check the utmp database for recent runlevel |
71 | changes.</para> | |
2218198b LP |
72 | </refsect1> |
73 | ||
74 | <refsect1> | |
75 | <title>Options</title> | |
359957ee LP |
76 | |
77 | <para>The following option is understood:</para> | |
78 | ||
79 | <variablelist> | |
80 | <varlistentry> | |
2218198b | 81 | <term><option>--help</option></term> |
359957ee | 82 | |
dfdebb1b | 83 | <xi:include href="standard-options.xml" xpointer="help-text" /> |
359957ee LP |
84 | </varlistentry> |
85 | </variablelist> | |
86 | ||
87 | </refsect1> | |
88 | ||
89 | <refsect1> | |
90 | <title>Exit status</title> | |
91 | ||
92 | <para>If one or both runlevels could be determined, 0 | |
93 | is returned, a non-zero failure code otherwise.</para> | |
94 | ||
95 | </refsect1> | |
96 | ||
97 | <refsect1> | |
98 | <title>Environment</title> | |
99 | ||
ccc9a4f9 | 100 | <variablelist class='environment-variables'> |
359957ee LP |
101 | <varlistentry> |
102 | <term><varname>$RUNLEVEL</varname></term> | |
103 | ||
104 | <listitem><para>If | |
105 | <varname>$RUNLEVEL</varname> is set, | |
106 | <command>runlevel</command> will print | |
107 | this value as current runlevel and | |
108 | ignore utmp.</para></listitem> | |
109 | </varlistentry> | |
110 | ||
111 | <varlistentry> | |
112 | <term><varname>$PREVLEVEL</varname></term> | |
113 | ||
114 | <listitem><para>If | |
79640424 | 115 | <varname>$PREVLEVEL</varname> is set, |
359957ee LP |
116 | <command>runlevel</command> will print |
117 | this value as previous runlevel and | |
118 | ignore utmp.</para></listitem> | |
119 | </varlistentry> | |
120 | </variablelist> | |
121 | </refsect1> | |
122 | ||
123 | <refsect1> | |
124 | <title>Files</title> | |
125 | ||
126 | <variablelist> | |
127 | <varlistentry> | |
df1e0204 | 128 | <term><filename>/var/run/utmp</filename></term> |
359957ee LP |
129 | |
130 | <listitem><para>The utmp database | |
131 | <command>runlevel</command> reads the | |
132 | previous and current runlevel | |
133 | from.</para></listitem> | |
134 | ||
135 | </varlistentry> | |
136 | </variablelist> | |
137 | </refsect1> | |
138 | ||
139 | <refsect1> | |
140 | <title>Notes</title> | |
141 | ||
dd17b384 | 142 | <para>This is a legacy command available for compatibility |
359957ee | 143 | only. It should not be used anymore, as the concept of |
dd17b384 | 144 | runlevels is obsolete.</para> |
359957ee LP |
145 | </refsect1> |
146 | ||
147 | <refsect1> | |
148 | <title>See Also</title> | |
149 | <para> | |
160cd5c9 | 150 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
dd17b384 | 151 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
359957ee LP |
152 | </para> |
153 | </refsect1> | |
154 | ||
155 | </refentry> |