-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
No reliable ways to wait for the end of the init of virtual terminals #10019
Description
Currently the console is supposed to be initialized by systemd-vconsole-setup.service. However the service unit is not run but instead a udev rule spawns directly systemd-vconsole-setup (binary) when the relevant device is added.
Due to this, there are no ways for a unit to order itself properly after the end of the init of the virtual terminals currently.
It's not a problem in practice because systemd-vconsole-setup seems fast enough to finish before services (with regular dependencies), that need terminal accesses, are started.
However this might be a problem for a service with default dependencies tuned OFF as it can be started at any time during the boot process.
And this is especially true if the service becomes the controlling process of the terminal (for example by setting Standard*=tty*) and is started in parallel with systemd-vconsole-setup. If the service exits
while systemd-vconsole-setup is still processing, it leaves the terminal in HUP state and systemd-vconsole-setup will fail to access the terminal onwards.
For services with regular dependencies (DefaultDependencies=on), it would be better if we could ordering them properly and make sure that systemd-vconsole-setup is done before starting such services. Perhaps by adding a new special target which would be activated once systemd-vconsole-setup.service is done. Those services would gain automatically Wants/After constraints on the new special target.
For services with DefaultDependencies=off, I think it would make sense to document the fact that if they use "Standard*=tty*" they should also use {Wants,After=systemd-vconsole-setup.service}.
WDYT ?