| 1 |
'\" t |
| 2 |
.TH "RUNLEVEL" "8" "" "systemd 257.13" "runlevel" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
runlevel \- Print previous and current SysV runlevel |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.HP \w'\fBrunlevel\fR\ 'u |
| 26 |
\fBrunlevel\fR [options...] |
| 27 |
.SH "OVERVIEW" |
| 28 |
.PP |
| 29 |
"Runlevels" are an obsolete way to start and stop groups of services used in SysV init\&. systemd provides a compatibility layer that maps runlevels to targets, and associated binaries like |
| 30 |
\fBrunlevel\fR\&. Nevertheless, only one runlevel can be "active" at a given time, while systemd can activate multiple targets concurrently, so the mapping to runlevels is confusing and only approximate\&. Runlevels should not be used in new code, and are mostly useful as a shorthand way to refer the matching systemd targets in kernel boot parameters\&. |
| 31 |
.sp |
| 32 |
.it 1 an-trap |
| 33 |
.nr an-no-space-flag 1 |
| 34 |
.nr an-break-flag 1 |
| 35 |
.br |
| 36 |
.B Table\ \&1.\ \&Mapping between runlevels and systemd targets |
| 37 |
.TS |
| 38 |
allbox tab(:); |
| 39 |
lB lB. |
| 40 |
T{ |
| 41 |
Runlevel |
| 42 |
T}:T{ |
| 43 |
Target |
| 44 |
T} |
| 45 |
.T& |
| 46 |
l l |
| 47 |
l l |
| 48 |
l l |
| 49 |
l l |
| 50 |
l l. |
| 51 |
T{ |
| 52 |
0 |
| 53 |
T}:T{ |
| 54 |
poweroff\&.target |
| 55 |
T} |
| 56 |
T{ |
| 57 |
1 |
| 58 |
T}:T{ |
| 59 |
rescue\&.target |
| 60 |
T} |
| 61 |
T{ |
| 62 |
2, 3, 4 |
| 63 |
T}:T{ |
| 64 |
multi\-user\&.target |
| 65 |
T} |
| 66 |
T{ |
| 67 |
5 |
| 68 |
T}:T{ |
| 69 |
graphical\&.target |
| 70 |
T} |
| 71 |
T{ |
| 72 |
6 |
| 73 |
T}:T{ |
| 74 |
reboot\&.target |
| 75 |
T} |
| 76 |
.TE |
| 77 |
.sp 1 |
| 78 |
.SH "DESCRIPTION" |
| 79 |
.PP |
| 80 |
\fBrunlevel\fR |
| 81 |
prints the previous and current SysV runlevel if they are known\&. |
| 82 |
.PP |
| 83 |
The two runlevel characters are separated by a single space character\&. If a runlevel cannot be determined, N is printed instead\&. If neither can be determined, the word "unknown" is printed\&. |
| 84 |
.PP |
| 85 |
Unless overridden in the environment, this will check the utmp database for recent runlevel changes\&. |
| 86 |
.SH "OPTIONS" |
| 87 |
.PP |
| 88 |
The following option is understood: |
| 89 |
.PP |
| 90 |
\fB\-\-help\fR |
| 91 |
.RS 4 |
| 92 |
Print a short help text and exit\&. |
| 93 |
.RE |
| 94 |
.SH "EXIT STATUS" |
| 95 |
.PP |
| 96 |
If one or both runlevels could be determined, 0 is returned, a non\-zero failure code otherwise\&. |
| 97 |
.SH "ENVIRONMENT" |
| 98 |
.PP |
| 99 |
\fI$RUNLEVEL\fR |
| 100 |
.RS 4 |
| 101 |
If |
| 102 |
\fI$RUNLEVEL\fR |
| 103 |
is set, |
| 104 |
\fBrunlevel\fR |
| 105 |
will print this value as current runlevel and ignore utmp\&. |
| 106 |
.RE |
| 107 |
.PP |
| 108 |
\fI$PREVLEVEL\fR |
| 109 |
.RS 4 |
| 110 |
If |
| 111 |
\fI$PREVLEVEL\fR |
| 112 |
is set, |
| 113 |
\fBrunlevel\fR |
| 114 |
will print this value as previous runlevel and ignore utmp\&. |
| 115 |
.RE |
| 116 |
.SH "FILES" |
| 117 |
.PP |
| 118 |
/run/utmp |
| 119 |
.RS 4 |
| 120 |
The utmp database |
| 121 |
\fBrunlevel\fR |
| 122 |
reads the previous and current runlevel from\&. |
| 123 |
.sp |
| 124 |
Added in version 237\&. |
| 125 |
.RE |
| 126 |
.SH "SEE ALSO" |
| 127 |
.PP |
| 128 |
\fBsystemd\fR(1), \fBsystemd.target\fR(5), \fBsystemctl\fR(1) |