Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 639166 - rc/sh/openrc-run.sh: Wrong usage of cgroup_add_service
Summary: rc/sh/openrc-run.sh: Wrong usage of cgroup_add_service
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-29 13:13 UTC by Patrick Lauer
Modified: 2017-12-01 22:00 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 Patrick Lauer gentoo-dev 2017-11-29 13:13:12 UTC
in rc/sh/openrc-run.sh ~line 267:

                        cgroup_add_service /sys/fs/cgroup/openrc
                        cgroup_add_service /sys/fs/cgroup/systemd/system

but rc/sh/rc-cgroup.sh cgroup_add_service() takes no parameters, and "just" relocates the current PID to the top level of all cgroup hierarchies.

So this code is redundant and misleading.
Comment 1 Patrick Lauer gentoo-dev 2017-11-29 14:28:55 UTC
I can't figure out from git history when this changed - 

2391ddff772ce541bc2237c89a2792a0b85e076c adds:
+       if [ -d "$1" ]; then
+               cgroup="$1/$RC_SVCNAME"

with that the syntax in openrc-run.sh makes sense.

But I don't see it removed, and I don't see it in the current file, so I'm very wtf
Comment 2 Patrick Lauer gentoo-dev 2017-11-29 14:32:32 UTC
Ah, it was undone in the merge commit of itself - 88cdcc145eb6343b94626ab3910a5eb1f8654212 merges the branch with the chance, had a conflict, and accidentally drops the important bit:

 -cgroup_set_limits()
 +cgroup_add_service()
  {
-       if [ -d "$1" ]; then
-               cgroup="$1/$RC_SVCNAME"
Comment 3 William Hubbs gentoo-dev 2017-12-01 22:00:36 UTC
This has been fixed in the following commit:

http://github.com/openrc/openrc/commit/cee3919