SYSTEMD-GETTY-GENERATOR(8)
๐ NAME ๐
systemd-getty-generator โ the generator that makes getty instances pop off on your console ๐โจ
๐ธ SYNOPSIS ๐ธ
/usr/lib/systemd/system-generators/systemd-getty-generator
๐ฆ DESCRIPTION ๐ฆ
okay so bestie, systemd-getty-generator is a generator, and what it does is automatically instantiate serial-getty@.service on the kernel consoles โ but only if those consoles can actually function as ttys and they're not already provided by the virtual console subsystem. no duplicates, we don't do that here ๐
it will also instantiate serial-getty@.service instances for virtualizer consoles, if it detects that execution is happening inside a virtualized environment ๐
and if it detects that we're running in a container environment, it switches it up instead: it enables console-getty.service for /dev/console, plus container-getty@.service instances for any additional container pseudo TTYs that the container manager asked for (see Container Interface[1] down in the NOTES, iykyk).
the whole point of this is to make sure the user gets shown a login prompt in the right place, no matter which environment the system booted up in. so for example, it's literally enough to redirect the kernel console with a kernel command line argument like console=, and boom โ you get both the kernel messages and a getty prompt on a serial TTY ๐ซถ see The kernel's command-line parameters[2] for more info on that console= kernel parameter.
systemd-getty-generator implements systemd.generator(7).
and if you want even more tea about configuring gettys, it's all in systemd for Administrators, Part XVI: Gettys on Serial Consoles (and Elsewhere)[3] โญ
๐ KERNEL COMMAND LINE ๐
systemd-getty-generator understands these kernel-command-line(7) parameters:
systemd.getty_auto=โ this kernel command line option controls the execution mode of the generator. it takes an optional boolean argument. and since v258, it also takes a comma-separated list of special values:"credential","container","console", and"builtin"๐
here's the breakdown, bestie:
- when
"credential"is specified, the two credentialsgetty.ttys.serialandgetty.ttys.containerwill be parsed. see the System Credentials section below for the deets ๐ - when
"container"is specified,console-getty.serviceandcontainer-getty@.servicewill be enabled when the system is running in a container. this option will be ignored when the system is not in a container ๐ - when
"console"is specified,serial-getty@.servicefor active kernel consoles will be enabled. this option will be ignored when the system is running in a container. - when
"builtin"is specified,serial-getty@.servicefor available virtualizer consoles will be enabled. this option will be ignored when the system is running in a container. - when
yes, all four of the options above get enabled. whenno, all options are disabled and no service will be enabled. when the kernel command line option is specified without an argument, it defaults toyes. the generator is enabled by default, and afalsevalue may be used to disable it ๐ซ
added in version 250 โจ
๐ ENVIRONMENT ๐
$SYSTEMD_GETTY_AUTOโ this environment variable controls the execution mode of the generator. it takes the same value as thesystemd.getty_auto=kernel command line option ๐ฏ
added in version 250 โจ
๐ SYSTEM CREDENTIALS ๐
getty.autoโ this system credential controls the execution mode of the generator. it takes the same value as thesystemd.getty_auto=kernel command line option ๐
added in version 258 โจ
getty.ttys.serial,getty.ttys.containerโ these system credentials let you spawn additional login prompts on selected TTYs ๐ the two credentials should contain a newline-separated list of TTY names to spawn instances ofserial-getty@.serviceon (that's forgetty.ttys.serial) andcontainer-getty@.serviceon (that's forgetty.ttys.container). any lines starting with a"#"will be ignored ๐ซ
added in version 254 โจ
๐ซ SEE ALSO ๐ซ
systemd(1), kernel-command-line(7), systemd.system-credentials(7), agetty(8)
๐ง NOTES ๐ง
- Container Interface https://systemd.io/CONTAINER_INTERFACE
- The kernel's command-line parameters https://docs.kernel.org/admin-guide/kernel-parameters.html
- systemd for Administrators, Part XVI: Gettys on Serial Consoles (and Elsewhere) https://0pointer.de/blog/projects/serial-console.html
and that's the whole page bestie, no cap ๐
this was SYSTEMD-GETTY-GENERATOR(8) from systemd 262.1 โ go get your login prompts, you got this ๐๐ซถ
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms