On 2013/7/29 15:14, Libo Chen wrote: > > example cgrules.conf: > > root:/home/clb/test.sh cpu test > > step: > 1. cd /home/clb > 2. cgexec ./test.sh > > Actual, the test.sh didn`t attach to test cgroup.
I want to explain more. cgexec ./test.sh the test.sh didn`t attach to test cgroup. #cgexec /home/clb/test.sh It is ok. So the problem is you must give a full path to cgexec, but cgrulesengd doesn't distinguish full and relative, both are ok. They should be consistent, otherwise it will confuse users. After patch relative path is ok for cgexec. > > Signed-off-by: Libo Chen <clbchenlibo.c...@huawei.com> > --- > src/api.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/api.c b/src/api.c > index e5e1959..c241f35 100644 > --- a/src/api.c > +++ b/src/api.c > @@ -696,6 +696,7 @@ static int cgroup_parse_rules(bool cache, uid_t muid, > } > > mproc_base = cgroup_basename(mprocname); > + procname = cgroup_basename(procname); > if (strcmp(mprocname, procname) && > strcmp(mproc_base, procname)) { > uid = CGRULE_INVALID; > ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel