]>
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 ZJS |
24 | <refentry id="runlevel" |
25 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
359957ee LP |
26 | |
27 | <refentryinfo> | |
28 | <title>runlevel</title> | |
29 | <productname>systemd</productname> | |
30 | ||
31 | <authorgroup> | |
32 | <author> | |
33 | <contrib>Developer</contrib> | |
34 | <firstname>Lennart</firstname> | |
35 | <surname>Poettering</surname> | |
36 | <email>lennart@poettering.net</email> | |
37 | </author> | |
38 | </authorgroup> | |
39 | </refentryinfo> | |
40 | ||
41 | <refmeta> | |
42 | <refentrytitle>runlevel</refentrytitle> | |
43 | <manvolnum>8</manvolnum> | |
44 | </refmeta> | |
45 | ||
46 | <refnamediv> | |
47 | <refname>runlevel</refname> | |
48 | <refpurpose>Print previous and current SysV runlevel</refpurpose> | |
49 | </refnamediv> | |
50 | ||
51 | <refsynopsisdiv> | |
52 | <cmdsynopsis> | |
53 | <command>runlevel <arg choice="opt" rep="repeat">options</arg></command> | |
54 | </cmdsynopsis> | |
55 | </refsynopsisdiv> | |
56 | ||
57 | <refsect1> | |
58 | <title>Description</title> | |
59 | ||
60 | <para><command>runlevel</command> prints the previous | |
61 | and current SysV runlevel if they are known.</para> | |
62 | ||
96d4ce01 | 63 | <para>The two runlevel characters are separated by a |
359957ee | 64 | single space character. If a runlevel cannot be |
af62c704 KS |
65 | determined, N is printed instead. If neither can be |
66 | determined, the word "unknown" is printed.</para> | |
359957ee | 67 | |
af62c704 | 68 | <para>Unless overridden in the environment, this will |
359957ee LP |
69 | check the utmp database for recent runlevel |
70 | changes.</para> | |
2218198b LP |
71 | </refsect1> |
72 | ||
73 | <refsect1> | |
74 | <title>Options</title> | |
359957ee LP |
75 | |
76 | <para>The following option is understood:</para> | |
77 | ||
78 | <variablelist> | |
79 | <varlistentry> | |
2218198b | 80 | <term><option>--help</option></term> |
359957ee | 81 | |
dfdebb1b | 82 | <xi:include href="standard-options.xml" xpointer="help-text" /> |
359957ee LP |
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 | |
92 | is returned, a non-zero failure code otherwise.</para> | |
93 | ||
94 | </refsect1> | |
95 | ||
96 | <refsect1> | |
97 | <title>Environment</title> | |
98 | ||
ccc9a4f9 | 99 | <variablelist class='environment-variables'> |
359957ee LP |
100 | <varlistentry> |
101 | <term><varname>$RUNLEVEL</varname></term> | |
102 | ||
103 | <listitem><para>If | |
104 | <varname>$RUNLEVEL</varname> is set, | |
105 | <command>runlevel</command> will print | |
106 | this value as current runlevel and | |
107 | ignore utmp.</para></listitem> | |
108 | </varlistentry> | |
109 | ||
110 | <varlistentry> | |
111 | <term><varname>$PREVLEVEL</varname></term> | |
112 | ||
113 | <listitem><para>If | |
79640424 | 114 | <varname>$PREVLEVEL</varname> is set, |
359957ee LP |
115 | <command>runlevel</command> will print |
116 | this value as previous runlevel and | |
117 | ignore utmp.</para></listitem> | |
118 | </varlistentry> | |
119 | </variablelist> | |
120 | </refsect1> | |
121 | ||
122 | <refsect1> | |
123 | <title>Files</title> | |
124 | ||
125 | <variablelist> | |
126 | <varlistentry> | |
6b76fa66 | 127 | <term><filename>/var/run/utmp</filename></term> |
359957ee LP |
128 | |
129 | <listitem><para>The utmp database | |
130 | <command>runlevel</command> reads the | |
131 | previous and current runlevel | |
132 | from.</para></listitem> | |
133 | ||
134 | </varlistentry> | |
135 | </variablelist> | |
136 | </refsect1> | |
137 | ||
138 | <refsect1> | |
139 | <title>Notes</title> | |
140 | ||
dd17b384 | 141 | <para>This is a legacy command available for compatibility |
359957ee | 142 | only. It should not be used anymore, as the concept of |
dd17b384 | 143 | runlevels is obsolete.</para> |
359957ee LP |
144 | </refsect1> |
145 | ||
146 | <refsect1> | |
147 | <title>See Also</title> | |
148 | <para> | |
160cd5c9 | 149 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
dd17b384 | 150 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
359957ee LP |
151 | </para> |
152 | </refsect1> | |
153 | ||
154 | </refentry> |