When running YaST2-Second-Stage.service, if you switch to a virtual console (e.g., ctrl + alt + F1), then getty prompt is shown. Before changes introduced by https://github.com/yast/yast-installation/pull/1024, systemd-user-sessions.service was forced to run after the second stage (actually, after the autoyast-initscripts.service). This prevented getty prompt while switching to a virtual console. Now, systemd-user-sessions.service runs before the second stage. So, systemd-getty-generator is able to instanciate a getty service when switching to a virtual console.
Note that YaST2-Second-Stage.service set Before=getty-pre.target, but this is not enough to avoid systemd-getty-generator instanciates getty services on demand.
Explicitly prevent getty services while running second stage. Note that only getty1 is prevented, so 2-6 are still available (for example, to collect logs).
Coverage remained the same at 39.566% when pulling cc103b3baf665debe0a7b8c9458f695f58a00fbc on joseivanlopez:avoid-login into 52ea63f76a33ff095737e26d42e4a76e2d5553bf on yast:SLE-15-SP3.
Problem
When running YaST2-Second-Stage.service, if you switch to a virtual console (e.g., ctrl + alt + F1), then getty prompt is shown. Before changes introduced by https://github.com/yast/yast-installation/pull/1024, systemd-user-sessions.service was forced to run after the second stage (actually, after the autoyast-initscripts.service). This prevented getty prompt while switching to a virtual console. Now, systemd-user-sessions.service runs before the second stage. So, systemd-getty-generator is able to instanciate a getty service when switching to a virtual console.
Note that YaST2-Second-Stage.service set
Before=getty-pre.target
, but this is not enough to avoid systemd-getty-generator instanciates getty services on demand.Solution
Explicitly prevent getty services while running second stage. Note that only getty1 is prevented, so 2-6 are still available (for example, to collect logs).
See also https://github.com/yast/yast-autoinstallation/pull/829.
Testing
Manually tested.