pid1: order units using TTYVHangup= after vconsole setup
The goal of this change is to delay getty services until after
systemd-vconsole-setup has finished. systemd-vconsole-setup starts loadkeys,
and it seems that when loadkeys is interrupted by the TTY hangup call we do
when starting tty services [1], so that loadkeys starts getting EIO from the
ioctl("/dev/tty1", KDSKBENT) syscall it does.
Fixes #26908.
[1] https://github.com/legionus/kbd/issues/92#issuecomment-1554451788
Initially I wanted to add ordering dependencies to individual units, but
TTYVHangup= can be added to other various external units too. The solution with
an implicit dependency should cover those cases too.
This commit is contained in:
@@ -6870,6 +6870,16 @@ bool exec_context_has_encrypted_credentials(ExecContext *c) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int exec_context_add_default_dependencies(Unit *u, const ExecContext *c) {
|
||||
assert(u);
|
||||
assert(u->default_dependencies);
|
||||
|
||||
if (c && exec_context_needs_term(c))
|
||||
return unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_VCONSOLE_SETUP_SERVICE,
|
||||
/* add_reference= */ true, UNIT_DEPENDENCY_DEFAULT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void exec_status_start(ExecStatus *s, pid_t pid) {
|
||||
assert(s);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user