Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 584962 - dev-libs/libcgroup: cgred service: incorrect path to cgconfig.conf, should pass -n to cgred
Summary: dev-libs/libcgroup: cgred service: incorrect path to cgconfig.conf, should pa...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-03 21:14 UTC by Nicolas Porcel
Modified: 2016-06-12 23:54 UTC (History)
0 users

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


Attachments
Fix libcgroup cgred daemon patch (0001-Fix-libcgroup-cgred-daemon.patch,998 bytes, patch)
2016-06-12 23:24 UTC, Nicolas Porcel
Details | Diff
Fix libcgroup cgred daemon patch v2 (0001-Fix-libcgroup-cgred-daemon.patch,1.38 KB, patch)
2016-06-12 23:26 UTC, Nicolas Porcel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Porcel 2016-06-03 21:14:50 UTC
The cgred service is not starting because cgrulesengd cannot find cgconfig.conf

Reproducible: Always




There are two problems with the cgred service. The first one is the path to the cgconfig.conf file which is wrong, causing cgrulesengd (the cgred daemon) to fail. This is fixed by adding this line to the ebuild script:

	sed -e 's:/etc/cgconfig.conf:/etc/cgroup/cgconfig.conf:' \
		-i src/libcgroup-internal.h || die "sed failed"
 

The second problem, once the first one is fixed, is that the cgred service loses track of the daemon, making it impossible to stop the service. This is because cgrulesengd fork itself to run in background, so the service loses track of the pid of the process. Adding the following line in /etc/conf.d/cgred fixes the problem, preventing the fork:

CGRED_OPTS="-n"

This option may be add directly in the init.d script.
Comment 1 Anthony Basile gentoo-dev 2016-06-06 17:13:18 UTC
(In reply to Nicolas Porcel from comment #0)
> The cgred service is not starting because cgrulesengd cannot find
> cgconfig.conf
> 
> Reproducible: Always
> 
> 
> 
> 
> There are two problems with the cgred service. The first one is the path to
> the cgconfig.conf file which is wrong, causing cgrulesengd (the cgred
> daemon) to fail. This is fixed by adding this line to the ebuild script:
> 
> 	sed -e 's:/etc/cgconfig.conf:/etc/cgroup/cgconfig.conf:' \
> 		-i src/libcgroup-internal.h || die "sed failed"
>  
> 
> The second problem, once the first one is fixed, is that the cgred service
> loses track of the daemon, making it impossible to stop the service. This is
> because cgrulesengd fork itself to run in background, so the service loses
> track of the pid of the process. Adding the following line in
> /etc/conf.d/cgred fixes the problem, preventing the fork:
> 
> CGRED_OPTS="-n"
> 
> This option may be add directly in the init.d script.


both sound reasonable. since you've tested these, do you mind producing a patch and i'll apply it.  this will prevent any guesswork on my part.  thanks.
Comment 2 Nicolas Porcel 2016-06-12 23:24:04 UTC
Created attachment 437296 [details, diff]
Fix libcgroup cgred daemon patch

You can find the patch attached, created from the portage tree git repository.
Comment 3 Nicolas Porcel 2016-06-12 23:26:08 UTC
Created attachment 437298 [details, diff]
Fix libcgroup cgred daemon patch v2

I forgot to add some file, please use this patch instead.
Comment 4 Anthony Basile gentoo-dev 2016-06-12 23:54:52 UTC
when you change the files that get installed on the system, you need to rev bump. i rev bumped for you.  can you please test 0.41-r4 and let me know everything is okay.  reopen this bug if there are any problems.

thanks for the fix!!!