-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document that Type=idle does not actually wait for all running jobs #4116
Comments
Type=idle is a hack whose only purpose is cosmetic - to decrease the chance of printing stuff to the console when the login prompt is already displayed. It was never meant as a reliable ordering feature. It will not wait for more than 5 seconds before getting bored and starting the service anyway. |
Thanks for pointing out the "5 seconds", I wasn't aware of that. So if that's a documentation bug, then let's treat it that way. I'm not pinned on Another way to enqueue a job after the initial boot transaction might be to run |
@martinpitt wouldn't it be sufficient to order the service |
@fsateler: yes, I'm currently experimenting with that and changing |
docfix waiting in #4348 |
Submission type
systemd version the issue has been seen with
Used distribution
In some cases there are running jobs after the default target is reached. In this case, commands from
Type=idle
services are already started after multi-user.target is reached, not after all running jobs are finished. This is contrary to what the manpage says: "execution of the service binary is delayed until all jobs are dispatched".Context: cloud-init is using a
Type=idle
unit to run package installations and arbitrary customization commands, which does not work well if the system is still booting up (new services installed by packages don't get started, or run into dependency loops).This can be reproduced in a VM or with
systemd-nspawn -b --bind sys
(as this needs udev). First, create aType=idle
unit that shows wheter the system is already booted and which jobs are running:Now cause a running job:
Reboot, and check:
So we see that we have a running job
dev-bogus.device
and systemd (rightfully) thinks it's still in the "starting" phase, not "running". And yet the idle command already fired.A full debug journal is at https://launchpadlibrarian.net/283485126/journal.txt with
dev-sda3.device
as the thing to wait for.Downstream bug: https://launchpad.net/bugs/1621846
The text was updated successfully, but these errors were encountered: