Bug 1648554

Summary: Time to virtual terminal login prompt doubled after upgrading to Fedora 29
Product: [Fedora] Fedora Reporter: Ricardo Garcia <fedora>
Component: systemdAssignee: systemd-maint
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: lnykryn, msekleta, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Boot log with "debug" verbosity
none
Normal boot process with service type "idle" none

Description Ricardo Garcia 2018-11-10 14:26:45 UTC
Created attachment 1504091 [details]
Boot log with "debug" verbosity

Description of problem:

First, some background information:

I've been using Fedora since Fedora 21, upgrading from one release to the next
one without reinstalling.

I belong to the more than probable minority of users who boot to a virtual
terminal and uses plymouth's text theme. This makes getty@.service critical for
me as that's my login prompt. The faster I get that, the better.

Now, the problem:

After upgrading to Fedora 29 I experienced a noticeable increase in the time it
takes for Fedora to show me the login prompt provided by agetty. Previously, it
took around 4 seconds from the Grub menu. In Fedora 29, those increased to
around 9 (i.e. it takes twice as long!).

After plotting the boot process with "systemd-analyze plot", adding "debug" to
the kernel command line and taking a look at the boot log as provided by
journald, I'm pretty sure the cause is getty@.service declaring the service type
to be "idle".

In the attached boot log, you can see in line 10268 how systemd is ready to
execute agetty and forks creating process 613, immediately declaring the service
as started (wall clock time 22:49:57). However, agetty is finally launched in
line 11158 (wall clock time 22:50:02) exactly 5 seconds later, which is the
timeout for services declared with type "idle". Note that, due to the BIOS clock
being in local time, the clock goes back one hour during the boot process so
don't let that confuse you.

By using "systemctl edit" I created a drop-in snippet in the following location:

/etc/systemd/system/getty@.service.d/override.conf

And used the following:

[Service]
Type=simple

By doing that, I go back to the login prompt being displayed after just 4
seconds. It's important to notice declaring a service as idle only serves the
purpose of making console output prettier by trying to avoid interleaved lines
and other processes "trashing" the screen. However, I don't experience any of
that. When agetty starts, plymouth goes away and the login prompt is clear. Even
if that wasn't the case, notice the idle timeout expires anyway and agetty is
launched without the system being idle, defeating the purpose of declaring the
unit as type idle.

I don't know about other distributions and the way they boot, but I'd argue for
Fedora it's better to just use type "simple" for getty@.service.

There's still the question of why this started happening after upgrading to
Fedora 29, given that in Fedora 28 getty@.service was also "idle" as far as I
can see. I don't have an answer for that and I didn't investigate.

If you think it's needed, I can provide a (probably blurry) video of my computer
booting to showcase the difference between "idle" and "simple" and the lack of
text trash in the login screen.

Version-Release number of selected component (if applicable):

systemd-239-6.git9f3aed1.fc29.x86_64

How reproducible:

Always reproducible in my system.

Steps to Reproduce:
1. Make multi-user.target the default target.
2. Measure the time to the login prompt.
3. Make getty@.service "simple" instead of "idle" and measure again.

Actual results:

Time to the login prompt is increased by 5 seconds.

Expected results:

Time to the login prompt is 5 seconds lower.


Additional info:

Comment 1 Ricardo Garcia 2018-11-10 14:28 UTC
Created attachment 1504092 [details]
Normal boot process with service  type "idle"