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 credentials getty.ttys.serial and getty.ttys.container will be parsed. see the System Credentials section below for the deets ๐Ÿ’œ
  • when "container" is specified, console-getty.service and container-getty@.service will 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@.service for 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@.service for 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. when no, all options are disabled and no service will be enabled. when the kernel command line option is specified without an argument, it defaults to yes. the generator is enabled by default, and a false value 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 the systemd.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 the systemd.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 of serial-getty@.service on (that's for getty.ttys.serial) and container-getty@.service on (that's for getty.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 ๐Ÿงš

  1. Container Interface https://systemd.io/CONTAINER_INTERFACE
  2. The kernel's command-line parameters https://docs.kernel.org/admin-guide/kernel-parameters.html
  3. 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