yast / yast-installation

YaST module installation
http://en.opensuse.org/Portal:YaST
GNU General Public License v2.0
16 stars 44 forks source link

Avoid login #1030

Closed joseivanlopez closed 2 years ago

joseivanlopez commented 2 years ago

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.

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 39.566% when pulling cc103b3baf665debe0a7b8c9458f695f58a00fbc on joseivanlopez:avoid-login into 52ea63f76a33ff095737e26d42e4a76e2d5553bf on yast:SLE-15-SP3.

yast-bot commented 2 years ago

:heavy_check_mark: Internal Jenkins job #9 successfully finished :heavy_check_mark: Created IBS submit request #266659