You are not logged in.

#1 2013-09-11 18:38:44

Sanjeev K Sharma
Registered: 2013-08-14
Posts: 72

"cgroup change of group failed" error with cgexec from libcgroup

I verify the group I'm testing with has started, has the right id/gid :

 ls -l /sys/fs/cgroup/memory/my_namestartx

Here's the command and error I'm trying to fix:

 cgexec   -g "memory,cpu:samstartx" /usr/bin/emacs
cgroup change of group failed

cgclassify gives the same error

tried with emacs, bash, man, urxvt   (root can run all of these, and can run cgclassify)

here's what I tried so far

I've edited /etc/cgconfig.conf

group samstartx {
	perm {
		task {
			uid = my_name;
		admin {
			uid = my_name;

these are the only uncommented lines

I've also tried

chmod 4755 /usr/bin/cgexec 

Any hints what to try next?
maybe there's a daemon I need to SIGHUP after editing /etc/cgconfig.conf?

looking more closely at the permissions under sys/fs, user is my_name but group is root so I did this as root

cgdelete -g memory,cpu:samstartx
cgcreate -a my_name:my_name  -g memory,cpu:samstartx

user & group are now both my_name but cgexec is Still a no-go

EDIT2: solved

sudo cgcreate -t my_name:my_name -a my_name:my_name  -g memory,cpu:my_namestartx ; ls -al /sys/fs/cgroup/memory/my_namestartx/
/usr/bin/cgexec   -g 'memory,cpu:samstartx/' /usr/bin/urxvt

that worked.  Then I deleted the cgroup(see cgdelete just above) , removed all entries from /etc/cgconfig.conf (all lines commented)

Ran the same cgcreate & cgexec again it worked.

That last cgexec is the one that I had not done chmod on  - I had copied the binary to a private directory & chmod-ed the private one

Last edited by Sanjeev K Sharma (2013-09-11 20:04:28)


Board footer

Powered by FluxBB