Avec systemd, les tty s’activent lorsqu’on bascule desssus en vertu de /etc/systemd/logind.conf.
$ cat /etc/systemd/logind.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# See logind.conf(5) for details
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
See logind.conf(5) for details
$ man logind.conf
[code]LOGIND.CONF(5) logind.conf LOGIND.CONF(5)
NAME
logind.conf - Login manager configuration file
SYNOPSIS
/etc/systemd/logind.conf
DESCRIPTION
This file configures various parameters of the systemd login manager, systemd-logind.service
OPTIONS
All options are configured in the “[Login]” section:
NAutoVTs=
Takes a positive integer. Configures how many virtual terminals (VTs) to allocate by default
that, when switched to and are previously unused, "autovt" services are automatically
spawned on. These services are instantiated from the template unit autovt@.service for the
respective VT TTY name, for example, autovt@tty4.service. By default, autovt@.service is
linked to getty@.service. In other words, login prompts are started dynamically as the user
switches to unused virtual terminals. Hence, this parameter controls how many login "gettys"
are available on the VTs. If a VT is already used by some other subsystem (for example, a
graphical login), this kind of activation will not be attempted. Note that the VT configured
in ReserveVT= is always subject to this kind of activation, even if it is not one of the VTs
configured with the NAutoVTs= directive. Defaults to 6. When set to 0, automatic spawning of
"autovt" services is disabled.
ReserveVT=
Takes a positive integer. Identifies one virtual terminal that shall unconditionally be
reserved for autovt@.service activation (see above). The VT selected with this option will
be marked busy unconditionally, so that no other subsystem will allocate it. This
functionality is useful to ensure that, regardless of how many VTs are allocated by other
subsystems, one login "getty" is always available. Defaults to 6 (in other words, there will
always be a "getty" available on Alt-F6.). When set to 0, VT reservation is disabled.[/code]
On peut éditer /etc/systemd/logind.conf pour définir [mono]NAutoVTs=N[/mono] ou [mono]ReserveVT=N[/mono].
[mono]NAutoVTs=N[/mono] : nombre de tty où login getty sera actif.
[mono]ReserveVT=N[/mono] : un tty réservé où un login getty sera automatiquement actif.
« By default, autovt@.service is linked to getty@.service »
À compléter :Comment faire quand on souhaite utiliser autre chose que getty ?
Comment faire avec agetty, ngetty, qingy … ?