chiark / gitweb /
headers: fix git URLs for source files
[elogind.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 General Public License as published by
12   the Free Software Foundation; either version 2 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   General Public License for more details.
19
20   You should have received a copy of the GNU General Public License
21   along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="runlevel">
25
26         <refentryinfo>
27                 <title>runlevel</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>runlevel</refentrytitle>
42                 <manvolnum>8</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>runlevel</refname>
47                 <refpurpose>Print previous and current SysV runlevel</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <cmdsynopsis>
52                         <command>runlevel <arg choice="opt" rep="repeat">options</arg></command>
53                 </cmdsynopsis>
54         </refsynopsisdiv>
55
56         <refsect1>
57                 <title>Description</title>
58
59                 <para><command>runlevel</command> prints the previous
60                 and current SysV runlevel if they are known.</para>
61
62                 <para>The two runlevel characters are separated by a
63                 single space character. If a runlevel cannot be
64                 determined, N is printed instead. If neither can be
65                 determined, the word "unknown" is printed.</para>
66
67                 <para>Unless overridden in the environment, this will
68                 check the utmp database for recent runlevel
69                 changes.</para>
70         </refsect1>
71
72         <refsect1>
73                 <title>Options</title>
74
75                 <para>The following option is understood:</para>
76
77                 <variablelist>
78                         <varlistentry>
79                                 <term><option>--help</option></term>
80
81                                 <listitem><para>Prints a short help
82                                 text and exits.</para></listitem>
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
99                 <variablelist>
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
114                                 <varname>$PREVLEVEL</varname> is set
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>
127                                 <term><varname>/var/run/utmp</varname></term>
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
141                 <para>This is a legacy command available for compatibility
142                 only. It should not be used anymore, as the concept of
143                 runlevels is obsolete.</para>
144         </refsect1>
145
146         <refsect1>
147                 <title>See Also</title>
148                 <para>
149                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
150                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
151                 </para>
152         </refsect1>
153
154 </refentry>