Bug 54247 - systemd boot messages in the login prompt
Summary: systemd boot messages in the login prompt
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-30 07:04 UTC by Jan Buchar
Modified: 2013-07-16 01:43 UTC (History)
10 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Output of 'journalctl -b' (159.30 KB, text/plain)
2013-06-21 14:28 UTC, Johann Bauer
Details
Proposed patch (870 bytes, patch)
2013-07-05 08:53 UTC, Harald Hoyer
Details | Splinter Review
Proposed revised patch (807 bytes, patch)
2013-07-05 08:55 UTC, Harald Hoyer
Details | Splinter Review

Description Jan Buchar 2012-08-30 07:04:48 UTC
After the login prompt appears during the boot process, systemd keeps spamming messages about services starting (mysql, ntp...). This should have been fixed some time ago by adding the Type=idle service parameter, which is already set in my getty service file (/usr/lib/systemd/system/getty@.service) without any results.

I'm running systemd 188 on Arch Linux
Comment 1 Jan Buchar 2012-08-31 08:43:47 UTC
The problem persists with systemd 189
Comment 2 bw.owlet 2012-09-14 18:51:14 UTC
I have the same situation.

I updated the system. During update some packages were replaced with 'systemd'. Then suggestion appeared - to append 'init=/bin/systemd' to kernel command line options in a bootloader. I did it in my syslinux bootloader.

After reboot a lot of messages appeared.
[ OK ] ..........
[ OK ] ..........
[ OK ] ..........

Here login prompt appears

[ OK ] ..........
[ OK ] ..........
[ OK ] ..........
Comment 3 Ross Geller 2012-10-14 07:51:08 UTC
I have the same problem. Arch Linux, systemd 194.

http://unix.stackexchange.com/questions/51805/systemd-messages-after-starting-login/
Comment 4 Michael Reiley 2012-11-06 23:34:38 UTC
Confirmed on ArchLinux x64 with systemd 195.
Comment 5 can 2012-11-21 21:48:39 UTC
One more confirmation Arch Linux x64 with systemd 195.

One thing to note is that this only happens with a slow disk (i.e 7.2K HDD) and never with an SSD (YMMV, though).

This leads me to believe that the SSD is simply masking the real problem; i.e the login prompt being displayed before all services are fully initialized.
Comment 6 Sudaraka Wijesinghe 2012-11-22 07:17:31 UTC
just wanted to subscribe and confirm the bug.

Arch Linix x86_64, systemd 195
Comment 7 lenz.simon 2012-12-16 11:24:01 UTC
I can also confirm this bug

systemd 196
64bit archlinux
Comment 8 nharris 2013-01-05 21:18:42 UTC
Confirming this bug.

systemd 196 on Arch x64
Comment 9 Pierre Adam 2013-01-07 06:48:47 UTC
I confirm the bug on systemd 196 and subscribe.
Archlinux 64bits.
Comment 10 Sudaraka Wijesinghe 2013-01-13 10:42:20 UTC
(In reply to comment #6)
> just wanted to subscribe and confirm the bug.
> 
> Arch Linix x86_64, systemd 195

I was able to solve my issue by changing the Type of the services (dhcpcd, httpd, mysqld) that was generating output after login prompt to "idle". (It was forking before)

This might not be a suitable final solution, but enough to get rid of the annoyance while permanent fix comes in.
Comment 11 Sudaraka Wijesinghe 2013-01-13 11:05:49 UTC
(In reply to comment #10)
> (In reply to comment #6)
> 
> I was able to solve my issue by changing the Type of the services (dhcpcd,
> httpd, mysqld) that was generating output after login prompt to "idle". (It
> was forking before)

Correction:
Had to revert httpd back to forking, still the problem went away by changing the other two.
Comment 12 RomaHagen 2013-02-25 03:00:34 UTC
This is still reproducible with systemd 197. Half a year and no reaction on this. Is this not a bug?
Comment 13 Boris 2013-04-14 05:42:01 UTC
reproduces on systemd-201-1
Comment 14 Zbigniew Jedrzejewski-Szmek 2013-06-03 19:25:55 UTC
(In reply to comment #13)
> reproduces on systemd-201-1

For some reason this appears to happen on Arch. Can you provide the output of 'journalctl -b' after booting with systemd.log_level=debug on the commandline?

Thanks.
Comment 15 Johann Bauer 2013-06-21 14:28:57 UTC
Created attachment 81168 [details]
Output of 'journalctl -b'

This still reproduces on 204. The output of 'journalctl -b' with systemd.log_level=debug is attached. I hope this helps. Thank you.
Comment 16 Zbigniew Jedrzejewski-Szmek 2013-06-23 15:53:33 UTC
OK, so we actually wait for other jobs to finish before Type=idle jobs are allowed to commence, but we *report* the other jobs afterwards.

[  OK  ] Started Login Service.
------------------ here actually systemd waits for slow.service -----

Fedora release 19 (Schrödinger’s Cat)
Kernel 3.9.2-200.fc18.x86_64 on an x86_64 (console)

fedora login: [  OK  ] Started slow.service.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
Comment 17 Zbigniew Jedrzejewski-Szmek 2013-06-24 03:34:38 UTC
Hm, actually my previous comment was totally wrong. We simply delay the idle jobs for a maximum of IDLE_TIMEOUT_USEC (which is defined to 5 s). It is relatively easy to have services which take more than 5 s to start, and then gettys will be launched while other things are still being started.

We could bump those 5 s to something bigger, but there are huge downsides - if something goes wrong, logging in will be impossible for longer, potentially indefinitely. So setting the timeout to something huge or infinity seems risky.

Type=idle is a hack, and it shows here. It's seems unlikely that we can find an IDLE_TIMEOUT_USEC value which will satisfy everybody. Actually 5 s seems to be a reasonable value.

A more complicated option would be to add an additional target, let's say multi-user-post.target, which would be After=multi-user.target, Requires=multi-user.target, and make getty services be part of it. It would be a solution with the similar downsides as simply increasing the IDLE_TIMEOUT_VALUE, unlikely to be worth it.

Dunno, we could also export IDLE_TIMEOUT_USEC as a config option. But it is a very low-level thingy, and not something that should be a part of the external interface. Maybe IDLE_TIMEOUT_USEC should instead be scaled by the number of jobs and processor speed or having a SSD/non-SSD disk. Again, probably not worth the hassle for a cosmetic issue.

I'm resetting this to NEW, maybe somebody can come up with a solution.
Comment 18 Tomasz Sobczyk 2013-07-04 12:30:50 UTC
For the problem you are discussing, it basically seems like systemd and the login prompt are outputting to the same console at the same time. getty is started and outputs the login prompt but systemd is still running and sends its own output.

Since systemd is PID 1 and monitors the whole system, then it should check whether something has grabbed the terminal before it outputs something to it... There's even TTYPath and the like in service files...
Comment 19 Harald Hoyer 2013-07-05 08:53:54 UTC
Created attachment 82068 [details] [review]
Proposed patch

Please check, if the proposed patch fixes your issue.
Comment 20 Harald Hoyer 2013-07-05 08:55:16 UTC
Created attachment 82069 [details] [review]
Proposed revised patch
Comment 21 Zbigniew Jedrzejewski-Szmek 2013-07-12 18:08:31 UTC
> Created attachment 82069 [details] [review] [review]
With this patch, all output is cut off immediately after getty start jobs are queued, and not only after the 5s timeout is done. This does the job, but totally destroys the whole idea of Type=idle.
Comment 22 Zbigniew Jedrzejewski-Szmek 2013-07-16 01:43:31 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=31a7eb8.

Type=idle jobs will wait for 5 s for the bootup to finish. If the bootup doesn't finish in time, the later part of output simply isn't shown.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.