pid1: order units using TTYVHangup= after vconsole setup
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 May 2023 13:50:04 +0000 (15:50 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 May 2023 15:46:30 +0000 (17:46 +0200)
commite019ea738d63d5f7803f378f8bd3e074d66be08f
treea8f337a6393fbe03eca19e34db3ffc0d09f585aa
parentce0fe01f22ea7907aef94329f0f641849fe020b3
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.
man/systemd.exec.xml
src/basic/special.h
src/core/execute.c
src/core/execute.h
src/core/mount.c
src/core/service.c
src/core/socket.c
src/core/swap.c