]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - units/getty@.service.m4
tmpfiles: support --image= similar to --root=
[thirdparty/systemd.git] / units / getty@.service.m4
index 17c76f5b3154e6065b24ab493a7cab6cf1e9dddb..087d68666605047678ad3b34caa34496ed41585a 100644 (file)
@@ -1,3 +1,5 @@
+#  SPDX-License-Identifier: LGPL-2.1+
+#
 #  This file is part of systemd.
 #
 #  systemd is free software; you can redistribute it and/or modify it
@@ -7,23 +9,10 @@
 
 [Unit]
 Description=Getty on %I
-After=systemd-user-sessions.service plymouth-quit-wait.service
-m4_ifdef(`TARGET_FEDORA',
-After=rc-local.service
-)m4_dnl
-m4_ifdef(`TARGET_ARCH',
-After=rc-local.service
-)m4_dnl
-m4_ifdef(`TARGET_FRUGALWARE',
-After=local.service
-)m4_dnl
-m4_ifdef(`TARGET_ALTLINUX',
-After=rc-local.service
-)m4_dnl
-m4_ifdef(`TARGET_MANDRIVA',
-After=rc-local.service
-)m4_dnl
-m4_ifdef(`TARGET_MAGEIA',
+Documentation=man:agetty(8) man:systemd-getty-generator(8)
+Documentation=http://0pointer.de/blog/projects/serial-console.html
+After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
+m4_ifdef(`HAVE_SYSV_COMPAT',
 After=rc-local.service
 )m4_dnl
 
@@ -33,14 +22,24 @@ After=rc-local.service
 Before=getty.target
 IgnoreOnIsolate=yes
 
-# On systems without virtual consoles, don't start any getty. (Note
+# IgnoreOnIsolate causes issues with sulogin, if someone isolates
+# rescue.target or starts rescue.service from multi-user.target or
+# graphical.target.
+Conflicts=rescue.service
+Before=rescue.service
+
+# On systems without virtual consoles, don't start any getty. Note
 # that serial gettys are covered by serial-getty@.service, not this
-# unit
+# unit.
 ConditionPathExists=/dev/tty0
 
 [Service]
-Environment=TERM=linux
-ExecStart=-/sbin/agetty %I 38400
+# the VT is cleared by TTYVTDisallocate
+# The '-o' option value tells agetty to replace 'login' arguments with an
+# option to preserve environment (-p), followed by '--' for safety, and then
+# the entered username.
+ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear %I $TERM
+Type=idle
 Restart=always
 RestartSec=0
 UtmpIdentifier=%I
@@ -48,16 +47,16 @@ TTYPath=/dev/%I
 TTYReset=yes
 TTYVHangup=yes
 TTYVTDisallocate=yes
+m4_ifdef(`ENABLE_LOGIND',,
 KillMode=process
+)m4_dnl
 IgnoreSIGPIPE=no
+SendSIGHUP=yes
 
 # Unset locale for the console getty since the console has problems
 # displaying some internationalized messages.
-Environment=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=
-
-# Some login implementations ignore SIGTERM, so we send SIGHUP
-# instead, to ensure that login terminates cleanly.
-KillSignal=SIGHUP
+UnsetEnvironment=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
 
 [Install]
-Alias=getty.target.wants/getty@tty1.service
+WantedBy=getty.target
+DefaultInstance=tty1