From d908b68c7d1fa6ad5a84bcf1fbf95d15af3d6093 Mon Sep 17 00:00:00 2001 From: Pontus Lundkvist Date: Fri, 3 Jan 2025 00:20:59 +0100 Subject: [PATCH] Remove no longer needed login-options override. Fixes agetty autologin. The need for -o was introduced in db6aeda to set the -p flag for login. Setting -o overrides agettys built-in handling of arguments, so "-- \\u" was needed to mimic it. This broke the autologin-feature, since the -f (noauth) flag is not passed to login [1]. But with 3d2157e, the -p flag is dropped, but the full change wasn't reverted, leaving autologin still broken - But for no reason since agetty does the right thing. Reference: [1]: https://github.com/util-linux/util-linux/blob/4e14b57/term-utils/agetty.c#L529-L550 --- units/console-getty.service.in | 4 +--- units/container-getty@.service.in | 4 +--- units/getty@.service.in | 4 +--- units/serial-getty@.service.in | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/units/console-getty.service.in b/units/console-getty.service.in index 33e6368db15..21821090097 100644 --- a/units/console-getty.service.in +++ b/units/console-getty.service.in @@ -20,9 +20,7 @@ Before=getty.target ConditionPathExists=/dev/console [Service] -# The '-o' option value tells agetty to replace 'login' arguments with '--' for -# safety, and then the entered username. -ExecStart=-/sbin/agetty -o '-- \\u' --noreset --noclear --keep-baud 115200,57600,38400,9600 - ${TERM} +ExecStart=-/sbin/agetty --noreset --noclear --keep-baud 115200,57600,38400,9600 - ${TERM} Type=idle Restart=always UtmpIdentifier=cons diff --git a/units/container-getty@.service.in b/units/container-getty@.service.in index 7573532d6dd..f24bb73fc1d 100644 --- a/units/container-getty@.service.in +++ b/units/container-getty@.service.in @@ -25,9 +25,7 @@ Conflicts=rescue.service Before=rescue.service [Service] -# The '-o' option value tells agetty to replace 'login' arguments with '--' for -# safety, and then the entered username. -ExecStart=-/sbin/agetty -o '-- \\u' --noreset --noclear - ${TERM} +ExecStart=-/sbin/agetty --noreset --noclear - ${TERM} Type=idle Restart=always RestartSec=0 diff --git a/units/getty@.service.in b/units/getty@.service.in index f30bba406d5..a43e01144fd 100644 --- a/units/getty@.service.in +++ b/units/getty@.service.in @@ -34,9 +34,7 @@ Before=rescue.service ConditionPathExists=/dev/tty0 [Service] -# The '-o' option value tells agetty to replace 'login' arguments with '--' for -# safety, and then the entered username. -ExecStart=-/sbin/agetty -o '-- \\u' --noreset --noclear - ${TERM} +ExecStart=-/sbin/agetty --noreset --noclear - ${TERM} Type=idle Restart=always RestartSec=0 diff --git a/units/serial-getty@.service.in b/units/serial-getty@.service.in index 20a5eb2754f..c0adaf7bdb8 100644 --- a/units/serial-getty@.service.in +++ b/units/serial-getty@.service.in @@ -30,9 +30,7 @@ Conflicts=rescue.service Before=rescue.service [Service] -# The '-o' option value tells agetty to replace 'login' arguments with '--' for -# safety, and then the entered username. -ExecStart=-/sbin/agetty -o '-- \\u' --noreset --noclear --keep-baud 115200,57600,38400,9600 - ${TERM} +ExecStart=-/sbin/agetty --noreset --noclear --keep-baud 115200,57600,38400,9600 - ${TERM} Type=idle Restart=always UtmpIdentifier=%I -- 2.47.3