Created attachment 81180 [details]
Distributions like Gentoo and Debian that needs to still support running logind without systemd being always running need to apply attached patch to prevent problems. The patch is being applied since March in Debian/Ubuntu without problems, and I thought that maybe upstream could be interested...
No way. that would mean we'd iterate through the entire cgroup tree on every single event loop iteration. Sorry, but that's not how we do things here.
Pacho, I didn't even consider forwarding this upstream, as it's too much of a hack..
Is there another way we could do something like this that wouldn't be considered a hack and that would be acceptable upstream?
Dunno what you guys are doing, but the idea is that systemd-cgroup-agent is hooked into /sys/fs/cgroup/systemd/release_agent and notify_release is on. With that in place I am not sure why you need any further work.
Ok, I have some things to do today, but when I get back later, I'll work on this on the Gentoo side. I believe I can set this up without the patch.
The goal is to make logind work without systemd so distros like Gentoo and Debian can use logind without requiring systemd right away.
If I create the named cgroup under /sys/fs/cgroup/system, can we use the
systemd-cgroups-agent without running system?
Can you give me any other tips to make this setup work?
I have looked at the code, and correct me if I am wrong, but it doesn't look like systemd-cgroup-agent can run if systemd isn't running because the cgroup agent sends a message over dbus to systemd, so I am researching the group agent mechanism to see exactly when the agent is run.
(In reply to comment #7)
> I have looked at the code, and correct me if I am wrong, but it doesn't look
> like systemd-cgroup-agent can run if systemd isn't running because the
> cgroup agent sends a message over dbus to systemd, so I am researching the
> group agent mechanism to see exactly when the agent is run.
That's right. I have a shelved patch to install the agent, but as you say this would need some rewiring first. We have this https://github.com/desrt/systemd-shim/ thing to implement the minimum required o.f.systemd interfaces and make things like suspend and NTP work properly, and eventually we need to teach it about the cgroup cleanup, too. Until then we use this hack.
It shouldn't be too hard to come up with the right command line of dbus-send to use for echoing into release_agent.
But you know: here's another way to make this work: just run systemd as PID 1.
We explicitly list logind as something that is not supported on non-systemd hosts. You do anyway -- so *you* need to find a way to make this work.