Closed hongkongkiwi closed 2 years ago
Thanks for the report, I'll consider it.
In my minimal kernel this just wasn't enabled (I'm running on a minimal embedded device), I had to do a bit of research to figure out why I was getting the error. Even though I wasn't using cgroup support in the finit config file.
I fixed the errors by adding these to my kernel config:
CONFIG_CGROUPS=y
CONFIG_CGROUP_SCHED=y
Ah, I really found this is causing lots of issues.
I don't have cgroup v2, because I'm running an older kernel. So, there was an error when setting up the init, system & user cgroups because I don't have cpu.weight groups.
finit thought this was an error, and killed my service. To fix this, I've removed them from the cgroup.c file so it looks like this:
/* Default (protected) groups, PID 1, services, and user/login processes */
cgroup_add("init", "", 1);
cgroup_add("system", "", 1);
cgroup_add("user", "", 1);
cgroup_config();
Now it seems that most services can start ok... atleast syslogd is working now (yay).
The next challenge I have is that finit <pid/SERVICE> conditions now do not fire. Perhaps this is related to some cgroup functions not being present?
I've conferred with colleagues now, we will likely not add support disabling cgroups. The effort of supporting that use-case is not worth it to us since it's not in line with ours, or the project's, goals. There are older versions of Finit available that don't require cgroups.
That's a shame, because as with many embedded devices, we are limited in the kernel version supported by our MCU vendor (4.9.14 in our case) and they are slow to update (or simply don't plan to), and so we don't have full cgroups v2 support.
If the goal is to support embedded systems, then not all of these will have kernel 5+.
This limits us to not being able to use finit, which is a shame as it's exactly the startup system I'm looking for. Much easier to use than s6-rc.
OK, flattery¹ will get you far with me :-)
Also, that's a good point you're making. I've recently run into a terrible vendor kernel myself, and I'm also changing jobs soon, so I'm reopening this and having a final look at it before the big v4.2 release I was just about to drop. Thanks for checking back!
__
¹ Re: s6
There, fixed. Finit v4.2 should work much better.
Thank you so much, I’ll give this a try! -- Sent from Gmail Mobile
I don't have cgroups support in my kernel, when trying to start a service (this case chrony) I get these errors in the logs:
Could you add a ./configure option to disable cgroup support?