-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Cleanup systemd apply #491
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
Conversation
|
LGTM |
|
Looks ok, but I don't know what original idea was behind this. Seems like we don't need systemd cgroup driver at all. We just need a support of systemd cgroup in fs driver, right? |
|
We still need to use the API to actually create the scope. Setting the values could be done by fs for now (till unified lands, at which point we might have to again use systemd APIs). |
|
@LK4D4 The plan is we share code as much as we can between fs cgroup and systemd cgroup, final goal is we don't use any systemd dbus APIs, use only fs cgroup to support both fs cgroup and systemd cgroup behavior. This PR is a first move. |
|
There are issues with removing DBus support for systemd. Granted, it is quite buggy (and it actually helped find some bugs in systemd, oddly enough). And yes, we end up using The main issue is that systemd's transient units aren't just another implementation of |
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.
I'm not sure if this is a good idea, it might cause systemd to change the cgroup paths the container joins (which might cause further issues).
|
@hqhq Also, why don't we just iterate over the |
@cyphar Yeah I know transient units aren't just another implementation of d.join, removing all DBus support for systemd could be difficult and I haven't figured out how exactly to do it and if it's worth doing. But for now, I think the goal is to share as much code with fs cgroup as we can, without impacting systemd users.
Not after #511 right? The only downside I see of removing this is we won't have configuration files like
Yeah we can do that, I just want to be step by step, see if we agreed on this goal and then we can clean up more. :) |
As far as I can tell, it might be an issue (#511 was concerned with making sure the cgroupfs stuff matches systemd). systemd makes weird decisions about which cgroups a unit it manages should be attached to. Among other things, it's based on what limits are enabled and set for the unit as well as the state of other units running on the system (which sounds like a bug to me, but the systemd guys appear to disagree with me about that). So, I'm not entirely sure. I'd prefer leaving the properties in until we can identify if any weird things happen when we remove them.
I'm +1 on anything that improves our testability (our test suite in runc is quite pitiful -- cgroup tests don't actually check that the limits are enforced). I'll take a look at the issue you referenced, FWIW. |
Do you mean that what limit should a process be set is uncertain? Like the shell: It's in different cgroups, but if we set the limit, it'll join the cgroup: Or do you mean something else that you think is a systemd bug? |
|
@hqhq Yes, that's what I meant. Although, after the PIDs cgroup changes, we explicitly join everything (which means that systemd is really only being used for systemd-specific signalling). So my earlier comment might be a red herring, I'm not sure. Something I just noticed is that the |
Signed-off-by: Qiang Huang <[email protected]>
13e2b4d to
ffbc347
Compare
| func joinCgroups(c *configs.Cgroup, pid int) error { | ||
| for _, sys := range subsystems { | ||
| name := sys.Name() | ||
| if name == "name=systemd" { |
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.
This should be a switch IMO.
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.
Updated, thanks.
ffbc347 to
bda7742
Compare
|
Now looks less breaking :) |
|
IANAM, but LGTM. I like this refactor. :D |
|
LGTM |
…onal schema/schema.json: Make 'hostname' optional
We are now setting all cgroup entries in fs way, no need to
use dbus for memory, cpu shares etc.
Signed-off-by: Qiang Huang [email protected]