Skip to content

Commit

Permalink
login: start the getty services earlier
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bcressey committed Oct 2, 2024
1 parent 9b5ac22 commit f9c6c29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/login/getty.drop-in.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Install]
WantedBy=preconfigured.target
8 changes: 7 additions & 1 deletion packages/login/login.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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}.

Expand All @@ -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

0 comments on commit f9c6c29

Please sign in to comment.