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=Getty on %I 12Documentation=man:agetty(8) man:systemd-getty-generator(8) 13Documentation=http://0pointer.de/blog/projects/serial-console.html 14After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target 15{% if HAVE_SYSV_COMPAT %} 16After=rc-local.service 17{% endif %} 18 19# If additional gettys are spawned during boot then we should make 20# sure that this is synchronized before getty.target, even though 21# getty.target didn't actually pull it in. 22Before=getty.target 23IgnoreOnIsolate=yes 24 25# IgnoreOnIsolate causes issues with sulogin, if someone isolates 26# rescue.target or starts rescue.service from multi-user.target or 27# graphical.target. 28Conflicts=rescue.service 29Before=rescue.service 30 31# On systems without virtual consoles, don't start any getty. Note 32# that serial gettys are covered by serial-getty@.service, not this 33# unit. 34ConditionPathExists=/dev/tty0 35 36[Service] 37# the VT is cleared by TTYVTDisallocate 38# The '-o' option value tells agetty to replace 'login' arguments with an 39# option to preserve environment (-p), followed by '--' for safety, and then 40# the entered username. 41ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM 42Type=idle 43Restart=always 44RestartSec=0 45UtmpIdentifier=%I 46StandardInput=tty 47StandardOutput=tty 48TTYPath=/dev/%I 49TTYReset=yes 50TTYVHangup=yes 51TTYVTDisallocate=yes 52{% if not ENABLE_LOGIND %} 53KillMode=process 54{% endif %} 55IgnoreSIGPIPE=no 56SendSIGHUP=yes 57 58# Unset locale for the console getty since the console has problems 59# displaying some internationalized messages. 60UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION 61 62[Install] 63WantedBy=getty.target 64DefaultInstance=tty1 65