Debian Codegraph @

upstream/debian-unstable/man1/localectl.1

raw
1 '\" t
2 .TH "LOCALECTL" "1" "" "systemd 261~rc3" "localectl"
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 localectl \- Control the system locale and keyboard layout settings
24 .SH "SYNOPSIS"
25 .HP \w'\fBlocalectl\fR\ 'u
26 \fBlocalectl\fR [OPTIONS...] {COMMAND}
27 .SH "DESCRIPTION"
28 .PP
29 \fBlocalectl\fR
30 may be used to query and change the system locale and keyboard layout settings\&. It communicates with
31 \fBsystemd-localed\fR(8)
32 to modify files such as
33 /etc/locale\&.conf
34 and
35 /etc/vconsole\&.conf\&.
36 .PP
37 The system locale controls the language settings of system services and of the UI before the user logs in, such as the display manager, as well as the default for users after login\&.
38 .PP
39 The keyboard settings control the keyboard layout used on the text console and of the graphical UI before the user logs in, such as the display manager, as well as the default for users after login\&.
40 .PP
41 Note that the changes performed using this tool might require the initrd to be rebuilt to take effect during early system boot\&. The initrd is not rebuilt automatically by
42 localectl, this task has to be performed manually, usually by reinstalling the distribution\*(Aqs kernel package\&.
43 .PP
44 Note that
45 \fBsystemd-firstboot\fR(1)
46 may be used to initialize the system locale for mounted (but not booted) system images\&.
47 .SH "COMMANDS"
48 .PP
49 The following commands are understood:
50 .PP
51 \fBstatus\fR
52 .RS 4
53 Show current settings of the system locale and keyboard mapping\&. If no command is specified, this is the implied default\&.
54 .sp
55 Added in version 195\&.
56 .RE
57 .PP
58 \fBset\-locale LOCALE\fR, \fBset\-locale VARIABLE=LOCALE\&...\fR
59 .RS 4
60 Set the system locale\&. This takes one locale such as
61 "en_US\&.UTF\-8", or takes one or more locale assignments such as
62 "LANG=de_DE\&.utf8",
63 "LC_MESSAGES=en_GB\&.utf8", and so on\&. If one locale without variable name is provided, then
64 "LANG="
65 locale variable will be set\&. See
66 \fBlocale\fR(7)
67 for details on the available settings and their meanings\&. Use
68 \fBlist\-locales\fR
69 for a list of available locales (see below)\&.
70 .sp
71 Added in version 195\&.
72 .RE
73 .PP
74 \fBlist\-locales\fR
75 .RS 4
76 List available locales useful for configuration with
77 \fBset\-locale\fR\&.
78 .sp
79 Added in version 195\&.
80 .RE
81 .PP
82 \fBset\-keymap MAP [TOGGLEMAP]\fR
83 .RS 4
84 Set the system keyboard mapping for the console and X11\&. This takes a mapping name (such as "de" or "us"), and possibly a second one to define a toggle keyboard mapping\&. Unless
85 \fB\-\-no\-convert\fR
86 is passed, the selected setting is also applied as the default system keyboard mapping of X11, after converting it to the closest matching X11 keyboard mapping\&. Use
87 \fBlist\-keymaps\fR
88 for a list of available keyboard mappings (see below)\&.
89 .sp
90 Added in version 195\&.
91 .RE
92 .PP
93 \fBlist\-keymaps\fR
94 .RS 4
95 List available keyboard mappings for the console, useful for configuration with
96 \fBset\-keymap\fR\&.
97 .sp
98 Added in version 195\&.
99 .RE
100 .PP
101 \fBset\-x11\-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]\fR
102 .RS 4
103 Set the system default keyboard mapping for X11 and the virtual console\&. This takes a keyboard mapping name (such as
104 "de"
105 or
106 "us"), and possibly a model, variant, and options, see
107 \fBkbd\fR(4)
108 for details\&. Unless
109 \fB\-\-no\-convert\fR
110 is passed, the selected setting is also applied as the system console keyboard mapping, after converting it to the closest matching console keyboard mapping\&.
111 .sp
112 Added in version 195\&.
113 .RE
114 .PP
115 \fBlist\-x11\-keymap\-models\fR, \fBlist\-x11\-keymap\-layouts\fR, \fBlist\-x11\-keymap\-variants [LAYOUT]\fR, \fBlist\-x11\-keymap\-options\fR
116 .RS 4
117 List available X11 keymap models, layouts, variants and options, useful for configuration with
118 \fBset\-keymap\fR\&. The command
119 \fBlist\-x11\-keymap\-variants\fR
120 optionally takes a layout parameter to limit the output to the variants suitable for the specific layout\&.
121 .sp
122 Added in version 201\&.
123 .RE
124 .SH "OPTIONS"
125 .PP
126 The following options are understood:
127 .PP
128 \fB\-l\fR, \fB\-\-full\fR
129 .RS 4
130 Do not ellipsize the output\&.
131 .sp
132 Added in version 257\&.
133 .RE
134 .PP
135 \fB\-\-no\-convert\fR
136 .RS 4
137 If
138 \fBset\-keymap\fR
139 or
140 \fBset\-x11\-keymap\fR
141 is invoked and this option is passed, then the keymap will not be converted from the console to X11, or X11 to console, respectively\&.
142 .sp
143 Added in version 195\&.
144 .RE
145 .PP
146 \fB\-H\fR, \fB\-\-host=\fR
147 .RS 4
148 Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
149 "@", to connect to\&. The hostname may optionally be suffixed by a port ssh is listening on, separated by
150 ":", and then a container name, separated by
151 "/", which connects directly to a specific container on the specified host\&. This will use SSH to talk to the remote machine manager instance\&. Container names may be enumerated with
152 \fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. Put IPv6 addresses in brackets\&.
153 .RE
154 .PP
155 \fB\-M\fR, \fB\-\-machine=\fR
156 .RS 4
157 Execute operation on a local container\&. Specify a container name to connect to, optionally prefixed by a user name to connect as and a separating
158 "@"
159 character\&. If the special string
160 "\&.host"
161 is used in place of the container name, a connection to the local system is made (which is useful to connect to a specific user\*(Aqs user bus:
162 "\-\-user \-\-machine=lennart@\&.host")\&. If the
163 "@"
164 syntax is not used, the connection is made as root user\&. If the
165 "@"
166 syntax is used either the left hand side or the right hand side may be omitted (but not both) in which case the local user name and
167 "\&.host"
168 are implied\&.
169 .RE
170 .PP
171 \fB\-\-no\-ask\-password\fR
172 .RS 4
173 Do not query the user for authentication for privileged operations\&.
174 .RE
175 .PP
176 \fB\-h\fR, \fB\-\-help\fR
177 .RS 4
178 Print a short help text and exit\&.
179 .RE
180 .PP
181 \fB\-\-version\fR
182 .RS 4
183 Print a short version string and exit\&.
184 .RE
185 .PP
186 \fB\-\-no\-pager\fR
187 .RS 4
188 Do not pipe output into a pager\&.
189 .RE
190 .SH "EXIT STATUS"
191 .PP
192 On success, 0 is returned, a non\-zero failure code otherwise\&.
193 .SH "ENVIRONMENT"
194 .PP
195 \fI$SYSTEMD_LOG_LEVEL\fR
196 .RS 4
197 The maximum log level of emitted messages (messages with a higher log level, i\&.e\&. less important ones, will be suppressed)\&. Takes a comma\-separated list of values\&. A value may be either one of (in order of decreasing importance)
198 \fBemerg\fR,
199 \fBalert\fR,
200 \fBcrit\fR,
201 \fBerr\fR,
202 \fBwarning\fR,
203 \fBnotice\fR,
204 \fBinfo\fR,
205 \fBdebug\fR, or an integer in the range 0\&...7\&. See
206 \fBsyslog\fR(3)
207 for more information\&. Each value may optionally be prefixed with one of
208 \fBconsole\fR,
209 \fBsyslog\fR,
210 \fBkmsg\fR
211 or
212 \fBjournal\fR
213 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
214 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
215 specifies to log at debug level except when logging to the console which should be at info level)\&. Note that the global maximum log level takes priority over any per target maximum log levels\&.
216 .RE
217 .PP
218 \fI$SYSTEMD_LOG_COLOR\fR
219 .RS 4
220 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
221 .sp
222 This setting is only useful when messages are written directly to the terminal, because
223 \fBjournalctl\fR(1)
224 and other tools that display logs will color messages based on the log level on their own\&.
225 .RE
226 .PP
227 \fI$SYSTEMD_LOG_TIME\fR
228 .RS 4
229 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
230 .sp
231 This setting is only useful when messages are written directly to the terminal or a file, because
232 \fBjournalctl\fR(1)
233 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
234 .RE
235 .PP
236 \fI$SYSTEMD_LOG_LOCATION\fR
237 .RS 4
238 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
239 .sp
240 Note that the log location is often attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
241 .RE
242 .PP
243 \fI$SYSTEMD_LOG_TID\fR
244 .RS 4
245 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
246 .sp
247 Note that the this information is attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
248 .RE
249 .PP
250 \fI$SYSTEMD_LOG_TARGET\fR
251 .RS 4
252 The destination for log messages\&. One of
253 \fBconsole\fR
254 (log to the attached tty),
255 \fBconsole\-prefixed\fR
256 (log to the attached tty but with prefixes encoding the log level and "facility", see
257 \fBsyslog\fR(3),
258 \fBkmsg\fR
259 (log to the kernel circular log buffer),
260 \fBjournal\fR
261 (log to the journal),
262 \fBjournal\-or\-kmsg\fR
263 (log to the journal if available, and to kmsg otherwise),
264 \fBauto\fR
265 (determine the appropriate log target automatically, the default),
266 \fBnull\fR
267 (disable log output)\&.
268 .RE
269 .PP
270 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
271 .RS 4
272 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
273 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
274 .RE
275 .PP
276 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
277 .RS 4
278 Pager to use when
279 \fB\-\-no\-pager\fR
280 is not given\&.
281 \fI$SYSTEMD_PAGER\fR
282 is used if set; otherwise
283 \fI$PAGER\fR
284 is used\&. If neither
285 \fI$SYSTEMD_PAGER\fR
286 nor
287 \fI$PAGER\fR
288 are set, a set of well\-known pager implementations is tried in turn, including
289 \fBless\fR(1)
290 and
291 \fBmore\fR(1), until one is found\&. If no pager implementation is discovered, no pager is invoked\&. Setting those environment variables to an empty string or the value
292 "cat"
293 is equivalent to passing
294 \fB\-\-no\-pager\fR\&.
295 .sp
296 Note: if
297 \fI$SYSTEMD_PAGERSECURE\fR
298 is not set,
299 \fI$SYSTEMD_PAGER\fR
300 and
301 \fI$PAGER\fR
302 can only be used to disable the pager (with
303 "cat"
304 or
305 ""), and are otherwise ignored\&.
306 .RE
307 .PP
308 \fI$SYSTEMD_LESS\fR
309 .RS 4
310 Override the options passed to
311 \fBless\fR
312 (by default
313 "FRSXMK")\&.
314 .sp
315 Users might want to change two options in particular:
316 .PP
317 \fBK\fR
318 .RS 4
319 This option instructs the pager to exit immediately when
320 Ctrl+C
321 is pressed\&. To allow
322 \fBless\fR
323 to handle
324 Ctrl+C
325 itself to switch back to the pager command prompt, unset this option\&.
326 .sp
327 If the value of
328 \fI$SYSTEMD_LESS\fR
329 does not include
330 "K", and the pager that is invoked is
331 \fBless\fR,
332 Ctrl+C
333 will be ignored by the executable, and needs to be handled by the pager\&.
334 .RE
335 .PP
336 \fBX\fR
337 .RS 4
338 This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal\&. It is set by default to allow command output to remain visible in the terminal even after the pager exits\&. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse\&.
339 .RE
340 .sp
341 Note that setting the regular
342 \fI$LESS\fR
343 environment variable has no effect for
344 \fBless\fR
345 invocations by systemd tools\&.
346 .sp
347 See
348 \fBless\fR(1)
349 for more discussion\&.
350 .RE
351 .PP
352 \fI$SYSTEMD_LESSCHARSET\fR
353 .RS 4
354 Override the charset passed to
355 \fBless\fR
356 (by default
357 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
358 .sp
359 Note that setting the regular
360 \fI$LESSCHARSET\fR
361 environment variable has no effect for
362 \fBless\fR
363 invocations by systemd tools\&.
364 .RE
365 .PP
366 \fI$SYSTEMD_PAGERSECURE\fR
367 .RS 4
368 Common pager commands like
369 \fBless\fR(1), in addition to "paging", i\&.e\&. scrolling through the output, support opening of or writing to other files and running arbitrary shell commands\&. When commands are invoked with elevated privileges, for example under
370 \fBsudo\fR(8)
371 or
372 \fBpkexec\fR(1), the pager becomes a security boundary\&. Care must be taken that only programs with strictly limited functionality are used as pagers, and unintended interactive features like opening or creation of new files or starting of subprocesses are not allowed\&. "Secure mode" for the pager may be enabled as described below,
373 \fIif the pager supports that\fR
374 (most pagers are not written in a way that takes this into consideration)\&. It is recommended to either explicitly enable "secure mode" or to completely disable the pager using
375 \fB\-\-no\-pager\fR
376 or
377 \fIPAGER=cat\fR
378 when allowing untrusted users to execute commands with elevated privileges\&.
379 .sp
380 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
381 \fBLESSSECURE=1\fR
382 will be set when invoking the pager, which instructs the pager to disable commands that open or create new files or start new subprocesses\&. Currently only
383 \fBless\fR(1)
384 is known to understand this variable and implement "secure mode"\&.
385 .sp
386 When set to false, no limitation is placed on the pager\&. Setting
387 \fISYSTEMD_PAGERSECURE=0\fR
388 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
389 .sp
390 When
391 \fI$SYSTEMD_PAGERSECURE\fR
392 is not set, systemd tools attempt to automatically figure out if "secure mode" should be enabled and whether the pager supports it\&. "Secure mode" is enabled if the effective UID is not the same as the owner of the login session, see
393 \fBgeteuid\fR(2)
394 and
395 \fBsd_pid_get_owner_uid\fR(3), or when running under
396 \fBsudo\fR(8)
397 or similar tools (\fI$SUDO_UID\fR
398 is set
399 \&\s-2\u[1]\d\s+2)\&. In those cases,
400 \fISYSTEMD_PAGERSECURE=1\fR
401 will be set and pagers which are not known to implement "secure mode" will not be used at all\&. Note that this autodetection only covers the most common mechanisms to elevate privileges and is intended as convenience\&. It is recommended to explicitly set
402 \fI$SYSTEMD_PAGERSECURE\fR
403 or disable the pager\&.
404 .sp
405 Note that if the
406 \fI$SYSTEMD_PAGER\fR
407 or
408 \fI$PAGER\fR
409 variables are to be honoured, other than to disable the pager,
410 \fI$SYSTEMD_PAGERSECURE\fR
411 must be set too\&.
412 .RE
413 .PP
414 \fI$SYSTEMD_COLORS\fR
415 .RS 4
416 Takes a boolean argument, or a special value\&. By default (unset),
417 \fBsystemd\fR
418 and related utilities will use colors in their output if possible\&. If
419 \fI$COLORTERM\fR
420 is set to
421 "truecolor"
422 or
423 "24bit", 24\-bit colors will be enabled, 256 colors otherwise, unless
424 \fI$NO_COLOR\fR
425 or
426 \fI$TERM\fR
427 indicates colors are disabled\&.
428 .PP
429 \fBtrue\fR
430 .RS 4
431 Same as unset, except that
432 \fI$NO_COLOR\fR
433 is ignored\&.
434 .RE
435 .PP
436 \fBfalse\fR
437 .RS 4
438 The output will be monochrome\&.
439 .RE
440 .PP
441 "16", "256", "24bit"
442 .RS 4
443 Always use the base 16 ANSI colors, 256 colors, or 24 bit color, respectively\&.
444 .RE
445 .PP
446 "auto\-16", "auto\-256", "auto\-24bit"
447 .RS 4
448 Use the given quantity of colours, subject to
449 \fI$TERM\fR, and what the console is connected to\&.
450 .RE
451 .RE
452 .PP
453 \fI$SYSTEMD_URLIFY\fR
454 .RS 4
455 The value must be a boolean\&. Controls whether clickable links should be generated in the output for terminal emulators supporting this\&. This can be specified to override the decision that
456 \fBsystemd\fR
457 makes based on
458 \fI$TERM\fR
459 and other conditions\&.
460 .RE
461 .SH "SEE ALSO"
462 .PP
463 \fBsystemd\fR(1), \fBlocale\fR(7), \fBlocale.conf\fR(5), \fBvconsole.conf\fR(5), \fBloadkeys\fR(1), \fBkbd\fR(4), \m[blue]\fBThe XKB Configuration Guide\fR\m[]\&\s-2\u[2]\d\s+2, \fBsystemctl\fR(1), \fBsystemd-localed.service\fR(8), \fBsystemd-firstboot\fR(1)
464 .SH "NOTES"
465 .IP " 1." 4
466 It is recommended for other tools to set and check
467 \fI$SUDO_UID\fR
468 as appropriate, treating it is a common interface.
469 .IP " 2." 4
470 The XKB Configuration Guide
471 .RS 4
472 \%http://www.x.org/releases/current/doc/xorg-docs/input/XKB-Config.html
473 .RE