1#  SPDX-License-Identifier: LGPL-2.1-or-later
2#
3#  This file is part of systemd.
4#
5#  systemd is free software; you can redistribute it and/or modify it
6#  under the terms of the GNU Lesser General Public License as published by
7#  the Free Software Foundation; either version 2.1 of the License, or
8#  (at your option) any later version.
9
10[Unit]
11Description=Console Getty
12Documentation=man:agetty(8) man:systemd-getty-generator(8)
13After=systemd-user-sessions.service plymouth-quit-wait.service
14{% if HAVE_SYSV_COMPAT %}
15After=rc-local.service getty-pre.target
16{% endif %}
17Before=getty.target
18
19# OCI containers may be run without a console
20ConditionPathExists=/dev/console
21
22[Service]
23# The '-o' option value tells agetty to replace 'login' arguments with an
24# option to preserve environment (-p), followed by '--' for safety, and then
25# the entered username.
26ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --keep-baud - 115200,38400,9600 $TERM
27Type=idle
28Restart=always
29UtmpIdentifier=cons
30StandardInput=tty
31StandardOutput=tty
32TTYPath=/dev/console
33TTYReset=yes
34TTYVHangup=yes
35{% if not ENABLE_LOGIND %}
36KillMode=process
37{% endif %}
38IgnoreSIGPIPE=no
39SendSIGHUP=yes
40
41[Install]
42WantedBy=getty.target
43