From f9c6c292dbdb2c223724754bc9d69cfd1f3a3f5e Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Wed, 2 Oct 2024 18:16:23 +0000 Subject: [PATCH] login: start the getty services earlier The login package is intended to help debug failures that occur early in boot, but by default the getty services are not started until `multi-user.target`, which is only activated if everything works as expected. Start the `getty.target` as part of `preconfigured.target` so that the login prompt will be available even if there are problems with networking or filesystem mounts. Signed-off-by: Ben Cressey --- packages/login/getty.drop-in.conf | 2 ++ packages/login/login.spec | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 packages/login/getty.drop-in.conf diff --git a/packages/login/getty.drop-in.conf b/packages/login/getty.drop-in.conf new file mode 100644 index 000000000..71627cb2a --- /dev/null +++ b/packages/login/getty.drop-in.conf @@ -0,0 +1,2 @@ +[Install] +WantedBy=preconfigured.target diff --git a/packages/login/login.spec b/packages/login/login.spec index 202cd4c60..54e2ed504 100644 --- a/packages/login/login.spec +++ b/packages/login/login.spec @@ -6,11 +6,13 @@ Release: 1%{?dist} Summary: A login helper License: Apache-2.0 OR MIT URL: https://github.com/bottlerocket-os/bottlerocket -Source0: login BuildRequires: %{_cross_os}glibc-devel Requires: %{_cross_os}bash Requires: %{_cross_os}systemd-console +Source0: login +Source1: getty.drop-in.conf + %description %{summary}. @@ -25,8 +27,12 @@ install -p -m 0755 %{S:0} %{buildroot}%{_cross_bindir}/login install -d %{buildroot}%{_cross_sbindir} ln -s ../bin/login %{buildroot}%{_cross_sbindir}/sulogin +install -d %{buildroot}%{_cross_unitdir}/getty.target.d +install -p -m 0644 %{S:1} %{buildroot}%{_cross_unitdir}/getty.target.d/001-login.conf + %files %{_cross_bindir}/login %{_cross_sbindir}/sulogin +%{_cross_unitdir}/getty.target.d/001-login.conf %changelog