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
nixos/systemd.nix: don’t require online for multi-user.target #86273
nixos/systemd.nix: don’t require online for multi-user.target #86273
Conversation
Not all systems need to be online to boot up. So, don’t pull network-online.target into multi-user.target. Services that need online network can still require it. This increases my boot time from ~9s to ~5s.
I think you need to reword this to decreases. I wonder how many services will get a changed behavior (undesirable) from online not being requried for multi-user.target. |
Confirmed my boot was faster with systemd-analyze. |
Some might, but then those services have to be fixed with an explicit dependency. @matthewbauer is doing the right thing here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decreased my boot time too
It looks like geoclue2 may have an issue with this:
I think this can be fixed by a |
|
I don't think so. If this is added to We shouldn't manually add |
This broke a bazillion tests and potentially even more services. @flokli and I will start looking into that now. |
@andir I was thinking the same thing with
TBH, I think reverts are more peaceful on master and then recombine the changes. |
Reverted in 15d761a:
|
Yep, you're right. I checked upstream and they don't pull it in either. |
IMHO, this is not what this is about. The main issue as I see it, is that while we can use upstream's units, the |
yeah, I agree it's not ideal, but I also don't see a nicer way to solve this currently. |
I'm completely baffled. Of course If some systems (or nixos tests) desire a different configuration, they should override it.
I would be astonished if systemd upstream are recommending that we distribute to our users an operating system distribution that doesn't enable networking by default. Searching their unit files, I can't find The question of whether it should want *Well, it looks like that's how their setup works.
How is everyone measuring this? The output of The important question is: what services are ordered after
|
@gloaming On most systems, you shouldn't have to connect to a network just to reach the login screen. You still need to have the network interfaces up (network.target) though, but that's not what this PR did (network-online.target). If multi-user.target automatically implies network-online.target, what's the point of having network-online.target? From systemd docs:
https://www.freedesktop.org/software/systemd/man/systemd.special.html#network-online.target Of course, you might still have to connect to the network later on, but that shouldn't block starting X11 / Wayland. 4s on my system might not seem like a lot, but on some worse network cards (like found on rpi0w), or worse connections, this can easily be 10+. Note that this PR was reverted, since it broke tests which incorrectly assume |
Yeah, it was reverted but there's another PR to bring it back (#86484) so I wanted to raise my concerns in the main discussion here. Indeed you shouldn't have to wait. But I haven't yet seen any evidence that we are. Setting The output of You want to find the time taken to reach the unit you actually care about, which is the login screen. You could try looking at the output of I think you might be a bit mixed up with requirements and ordering dependencies? The two are completely orthogonal. If you have even a single service that wants Moreover, a dependency cannot cause a delay; only an ordering can cause a delay.
What can? What are you measuring? Also: It's fine if people want to change the dependency on |
Maybe it was just a placebo! I can't get an actual boot up time improvement from this change. I had been using There may still be an argument for making multi-user.target happen earlier. We don't have many |
Cool :) Hmm, I can't think of any reason any service should order after I guess it depends on the use case - if you're running a server, you might well be interested in the "boot time" until the server is reachable from the outside. But it's not what most people would think of as boot time. So in conclusion - we should probably have |
Not all systems need to be online to boot up. So, don’t pull
network-online.target into multi-user.target. Services that need
online network can still require it.
This decreases my boot time from ~9s to ~5s.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)