Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 477218 - sys-apps/openrc-0.11.8: Missing codeline in /etc/init.d/sysfs, l.77
Summary: sys-apps/openrc-0.11.8: Missing codeline in /etc/init.d/sysfs, l.77
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 439098
  Show dependency tree
 
Reported: 2013-07-17 13:56 UTC by Guido Jäkel
Modified: 2014-07-15 06:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Jäkel 2013-07-17 13:56:08 UTC
Updating to openrc-0.11.8, the  cgroupfs  is mounted at  /sys/fs/cgroup/openrc/ despite of the setting  rc_controller_cgroups="NO"  in  /etc/rc.conf

I think a line has bee lost in  /etc/init.d/sysfs at line 77ff:

mount_cgroups()
{
* HERE A LINE MAY BE GONE, the next line is shifted in! *
                mountinfo -q /sys/fs/cgroup || return 0

        local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
        mkdir /sys/fs/cgroup/openrc

Compared to openrc-0.9.9.3, the missing line might be

        yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] && \


From a quick discussion on #openrc it turns out, that there is already a fix upstream (qnikst: 3df0bd64cb8d520cb4e65b1ac307d0b9fa4e83c3 <- that patch)
Comment 1 William Hubbs gentoo-dev 2013-07-17 15:10:01 UTC
This will be in version 0.12.
Comment 2 Guido Jäkel 2014-07-14 08:29:07 UTC
Dear William,
while performing the yearly update i have to deal with this for sys-apps/openrc-0.12.4, again.

IMHO the mentioned patch restores the missing statements at another line. But this is done after the first mount and therefore it don't work as expected to me - the switch now will just disable the mounting of cgroup controllers but not mounting an instance of the cgroup fs itself. Beside, the line with the first mountinfo is still shifted in.
 
 mount_cgroups()
 {
-       yesno ${rc_cgroups:-YES} && [ -e /proc/cgroups ] && \
                mountinfo -q /sys/fs/cgroup || return 0
 
        local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
@@ -83,6 +82,8 @@ mount_cgroups()
                -o none,nodev,noexec,nosuid,name=openrc,release_agent="$agent" \
                openrc /sys/fs/cgroup/openrc
        echo 1 > /sys/fs/cgroup/openrc/notify_on_release
+
+       yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
        while read name hier groups enabled rest; do
                case "${enabled}" in
                        1)      mkdir /sys/fs/cgroup/${name}
Comment 3 William Hubbs gentoo-dev 2014-07-14 21:12:15 UTC
Hi Guido,

(In reply to Guido Jäkel from comment #2)
> IMHO the mentioned patch restores the missing statements at another line.
> But this is done after the first mount and therefore it don't work as
> expected to me - the switch now will just disable the mounting of cgroup
> controllers but not mounting an instance of the cgroup fs itself. Beside,
> the line with the first mountinfo is still shifted in.

The file system that is mounted on /sys/fs/cgroup  is only a tmpfs; it isn't a cgroup fs.

The /sys/fs/cgroup/openrc cgroupfs does not haveany controllers attached to it, so it shouldn't interfere with anything.

The rc_controller_cgroups switch is now working as designed. Its purpose is to control the mounting of the controller cgroups, but that's it.

The indentation has been fixed in git; that line should not be shifted in.
Comment 4 Guido Jäkel 2014-07-15 06:32:55 UTC
Hi William,

> The file system that is mounted on /sys/fs/cgroup  is only a tmpfs; it isn't
> a cgroup fs.

Right (, this is done elsewhere), but the "openrc" is one and this was disabled by the (renamed) switch before.

> The /sys/fs/cgroup/openrc cgroupfs does not have any controllers attached to
> it, so it shouldn't interfere with anything.
> 
> The rc_controller_cgroups switch is now working as designed. Its purpose is
> to control the mounting of the controller cgroups, but that's it.

I found the thread #423317 - the point there is very similar. I read from it that "you" need this for openrc to (optional) kill tasks of a service. From the comments in /etc/rc.conf i see that this will become a successor of pid file based task termination.

Therefore i have to "give in" and follow the standards, i.e. to work on the stuff that's not aware to arbitrary locations and multiple instances of cgroup file systems and it's controllers and not to "fix" something here which is broken elsewhere.


Thank you for quick reply and the discussion.

Guido