]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Miscellaneous scripts and libcg bug fixes
authorBalbir Singh <balbir@linux.vnet.ibm.com>
Fri, 18 Apr 2008 05:34:12 +0000 (05:34 +0000)
committerBalbir Singh <balbir@linux.vnet.ibm.com>
Fri, 18 Apr 2008 05:34:12 +0000 (05:34 +0000)
Turn off -DDEBUG in Makefile

Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@18 4f4bb910-9a46-0410-90c8-c897d4f1cd53

Makefile
api.c
scripts/doc/howto.txt

index 9c175fa51d3602577df2a9e6abf33a36fe065694..40737d3a224c914b935b3ac4ab46abfeded0871b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@
 YACC_DEBUG=-t
 DEBUG=-DDEBUG
 INC=-I.
-CFLAGS=-g -O2 -Wextra $(DEBUG)  $(INC) 
+CFLAGS=-g -O2 -Wextra $(INC) 
 LIBS= -lcg
 LDFLAGS= -L .
 INSTALLPREFIX=
diff --git a/api.c b/api.c
index c2d6ef9863251a08f9072535b01ad701e318c159..b7a224f2f9cfc99e01506b3ae057b4a9b5b1dfc8 100644 (file)
--- a/api.c
+++ b/api.c
@@ -106,6 +106,9 @@ int cg_init()
        int ret = 0;
 
        proc_mount = fopen("/proc/mounts", "r");
+       if (proc_mount == NULL) {
+               return EIO;
+       }
 
        while ((ent = getmntent(proc_mount)) != NULL) {
                if (!strncmp(ent->mnt_fsname,"cgroup", strlen("cgroup"))) {
@@ -406,14 +409,14 @@ int cg_delete_cgroup(struct cgroup *cgroup, int ignore_migration)
        int error = ECGROUPNOTALLOWED;
 
        strcpy(path, MOUNT_POINT);
-       strcat(path,"/tasks");
+       strcat(path,"tasks");
 
        base_tasks = fopen(path, "w");
        if (!base_tasks)
                goto base_open_err;
 
        cg_build_path(cgroup->name, path);
-       strcat(path,"/tasks");
+       strcat(path,"tasks");
 
        delete_tasks = fopen(path, "r");
        if (!delete_tasks)
index 38c95e3dd162efdd78c3fda60d9bcdd25673aa89..c6796d683e6424775e8bbdc38e184b47c0d096e9 100644 (file)
@@ -35,6 +35,20 @@ class2  cpu.shares=512
 The configuration below creates two classes class1 and class2 and
 assigns shares of 1024 to class1 and 512 to class1.
 
+The other options that can be specified are
+
+tuid = owner of the tasks file
+tgid = group permissions of the tasks file
+cuid = owner of the newly created node
+cgid = group permissions of the newly created node
+
+Example
+
+class1 cpu.shares = 1024 tuid=root tgid=root cuid=database cgid=database.
+
+By default all these files are owned by root. The flexibilty of specifying
+owners makes it easier for other applications to use resource management.
+
 Intialization script
 --------------------