chiark / gitweb /
man: minor fixes
[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="systemd">
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 seperated 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 overriden in the environment this will
68                 check the utmp database for recent runlevel
69                 changes.</para>
70
71                 <para>The following option is understood:</para>
72
73                 <variablelist>
74                         <varlistentry>
75                                 <term>--help</term>
76
77                                 <listitem><para>Prints a short help
78                                 text and exits.</para></listitem>
79                         </varlistentry>
80                 </variablelist>
81
82         </refsect1>
83
84         <refsect1>
85                 <title>Exit status</title>
86
87                 <para>If one or both runlevels could be determined, 0
88                 is returned, a non-zero failure code otherwise.</para>
89
90         </refsect1>
91
92         <refsect1>
93                 <title>Environment</title>
94
95                 <variablelist>
96                         <varlistentry>
97                                 <term><varname>$RUNLEVEL</varname></term>
98
99                                 <listitem><para>If
100                                 <varname>$RUNLEVEL</varname> is set,
101                                 <command>runlevel</command> will print
102                                 this value as current runlevel and
103                                 ignore utmp.</para></listitem>
104                         </varlistentry>
105
106                         <varlistentry>
107                                 <term><varname>$PREVLEVEL</varname></term>
108
109                                 <listitem><para>If
110                                 <varname>$PREVLEVEL</varname> is set
111                                 <command>runlevel</command> will print
112                                 this value as previous runlevel and
113                                 ignore utmp.</para></listitem>
114                         </varlistentry>
115                 </variablelist>
116         </refsect1>
117
118         <refsect1>
119                 <title>Files</title>
120
121                 <variablelist>
122                         <varlistentry>
123                                 <term><varname>/var/run/utmp</varname></term>
124
125                                 <listitem><para>The utmp database
126                                 <command>runlevel</command> reads the
127                                 previous and current runlevel
128                                 from.</para></listitem>
129
130                         </varlistentry>
131                 </variablelist>
132         </refsect1>
133
134         <refsect1>
135                 <title>Notes</title>
136
137                 <para>This is a legacy command available for compatibility
138                 only. It should not be used anymore, as the concept of
139                 runlevels is obsolete.</para>
140         </refsect1>
141
142         <refsect1>
143                 <title>See Also</title>
144                 <para>
145                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
146                 </para>
147         </refsect1>
148
149 </refentry>