summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Generate everythingautomakeJan Safranek2009-03-2622-2042/+42634
| | | | | | Finally run autoreconf -f -i to generate all the stuff that should be generated Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Fix compilation of some stuffJan Safranek2009-03-261-1/+1
| | | | | | | yacc does not generate y.tab.h, it has different name now. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Add warrning when test script is started by normal userJan Safranek2009-03-261-0/+7
| | | | | | | | The runlibcgrouptest.sh will now whine when script is started by non-root user. Root permissions are needed to create directories and mount the cgroups there. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Fix runlibcgrouptest.sh exit codesJan Safranek2009-03-261-5/+10
| | | | | | | | | Automake's 'make check' executes runlibcgrouptest.sh automatically. It interprets exit code '77' as 'skip the test' and it is not counted as failure. Also the script should return nozero exit code != 77 when some test fails. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Disable compilation of static librariesJan Safranek2009-03-261-0/+2
| | | | | | | | | Disable compilation of static libraries. Static libraries (.a files) should not be compiled by default, shared library is better for LGPL licensed code. Still, one can enable static libraries with ./configure --enable-static Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Make runlibcgrouptest.sh executableJan Safranek2009-03-261-0/+0
| | | | | | runlibcgrouptest.sh should be executable, so 'make check' can execute it. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Add automake makefilesJan Safranek2009-03-2613-6/+90
| | | | | | | | Add automake makefiles and prepare everything to run, but don't actually run the automake - it would generate lot of noise, where my manual changes would get lots. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Clean up the scripts directoryJan Safranek2009-03-269-458/+0
| | | | | | | | The directory contains samples and howto, which is not relevant anymore. Sample configuration files should be in ../samples and (relevant) documentation in ../doc Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Remove wml samplesJan Safranek2009-03-262-108/+0
| | | | | | The samples are not relevant anymore? Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Remove mktarballJan Safranek2009-03-262-72/+0
| | | | | | The mktarball script is not needed anymore use 'make dist' instead. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Remove tests/MakefileJan Safranek2009-03-261-38/+0
| | | | | | Remove tests/Makefile, it will be replaced by automake generated one. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Distribute files to various subdirectoriesJan Safranek2009-03-2619-0/+0
| | | | Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* libcgroup: Version bumpDhaval Giani2009-03-262-10/+10
| | | | | | Start the v0.34 cycle for development. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Minor fix to cgconfig init scriptIvana Varekova2009-03-261-0/+5
| | | | | | | | | | | | | | cgconfig script does not test the return value of cgconfigparser command so it continues to simulate start of the service, even if it was not pass successfuly. This is the first part of the patch from: http://sourceforge.net/mailarchive/forum.php?thread_name=20090120121851.GC4422%40linux.vnet.ibm.com&forum_name=libcg-devel which was not incorporated yet. Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Fix of the return valuesIvana Varekova2009-03-261-5/+10
| | | | | | | This patch fixes a few error values in api.c file. Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Add PACKAGE_VERSION to MakefileJan Safranek2009-03-261-0/+1
| | | | | | | | | | By removing PACKAGE_VERSION in SVN rev. 344 I broke 'make install' - the macro must be defined there, 'make install' needs it to build library symlinks. I am sorry, I should have noticed it earlier. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Move binaries and libraries to /bin and /libJan Safranek2009-03-091-11/+9
| | | | | | | | | Since cgconfig starts before nfs shares are mounted, it should not use anything on /usr (it can be on nfs too). All the libcgroup libraries and binaries should be therefore in /. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Start the config earlierJan Safranek2009-03-091-3/+3
| | | | | | | | | | We could start cgconfig service earlier, even before network and syslog. $local_fs is not needed, because /bin, /sbin and /etc are guaranteed by rc.sysinit (see Fedora bug #309001, https://bugzilla.redhat.com/show_bug.cgi?id=309001). Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* libcgroup: Initialize buffer in config.cDhaval Giani2009-03-041-1/+2
| | | | | | | | Fix the warning, config.c: In function ‘cgroup_config_parse_controller_options’: config.c:104: warning: ‘buffer’ may be used uninitialized in this function Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* libcgroup: Removed unused functions from api.cDhaval Giani2009-03-041-45/+0
| | | | | | | | | | api.c: At top level: api.c:1780: warning: ‘cg_prepare_controller_array’ defined but not used api.c:1805: warning: ‘cg_free_controller_array’ defined but not used Turns out no one is using this functions. Remove them. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* libcgroup: Fix unused variable warnings for the walk_tree APIDhaval Giani2009-03-041-2/+0
| | | | | | | | | | | | api.c: In function ‘cg_walk_node’: api.c:2252: warning: unused variable ‘base_level’ api.c: In function ‘cgroup_walk_tree_end’: api.c:2314: warning: unused variable ‘ret’ Fix the above warnings. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
* libcgroup: Introduce -Wall in CFLAGSDhaval Giani2009-03-042-0/+2
| | | | | | | We did not have -Wall in the CFLAGS and lost out on a number of warnings because of that. Introduce it now. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* libcgroup: Check if the data structures have been initialized for walk_treeDhaval Giani2009-03-041-0/+12
| | | | | | | | The test for cgroup_init() was not being done by the walk tree APIs. With this it is possible for it to run without cgroup_init() being called and having mysterious failures. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* libcgroup: Dont check for success of moved tasksDhaval Giani2009-03-041-1/+1
| | | | | | | | | | | | | | | | Sometime the movement of tasks in the default cgroup can fail for various reasons. Therefore, do not check for the success of the movement of tasks. Justification: These are generally for cgroups which need some special setup, for example the RT group scheduler. This is not handled by the library whihc is generic. If a user is intersted in these working, they will setup a default cgroup in the config files whihc handle everything they need. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Tested-by: Jan Safranek <jsafrane@redhat.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
* Fix a compiling warningKen'ichi Ohmichi2009-03-021-0/+1
| | | | | | | | | | | | | | | | | | | This patch fixes the following warning of libcgroup-0.33. $ make flex lex.l byacc -v -d parse.y byacc: 2 shift/reduce conflicts cc -g -O2 -I. -shared -fPIC -Wl,--soname,libcgroup.so.1 -o libcgroup.so \ -Wl,--version-script,libcgroup.map,--allow-shlib-undefined \ api.c wrapper.c lex.yy.c y.tab.c config.c lex.l: In function 'yylex': lex.l:30: warning: incompatible implicit declaration of built-in function 'strdup' [snip] $ Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Tag v0.33Dhaval Giani2009-02-280-0/+0
| | | | | | | Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/tags/v0.33@357 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Feature: Provide new libcgroup walk tree APIDhaval Giani2009-02-285-1/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From: Balbir Singh <balbir@linux.vnet.ibm.com> Changelog v3..v4 1. Add _end() method for the iterator Changelog v3..v2 1. Move to iterator based design Changelog v2..v1 1. Add base path and depth semantics for walking This patch adds the capability to walk cgroups by providing a new API called cgroup_walk_tree. The API accepts the controller to walk and the order in which the directories and files must be visited. The code is implemented as an iterator, the begin function starts the walk and we have depth control. The next function gets the following node and returns ECGEOF when done. libcgroup.map has been updated to reflect the same change and the prototype is exported in libcgroup.h. I've also added test cases (tests/walk_test.c). Sample output is show root is /cgroup/cpu/// path , parent , relative /, full /cgroup/cpu/// path l3, parent , relative /l3, full /cgroup/cpu///l3 path ll1, parent l3, relative /l3/ll1, full /cgroup/cpu///l3/ll1 path lll1, parent ll1, relative /l3/ll1/lll1, full /cgroup/cpu///l3/ll1/lll1 path l2, parent , relative /l2, full /cgroup/cpu///l2 path ll1, parent l2, relative /l2/ll1, full /cgroup/cpu///l2/ll1 path lll1, parent ll1, relative /l2/ll1/lll1, full /cgroup/cpu///l2/ll1/lll1 path l1, parent , relative /l1, full /cgroup/cpu///l1 path ll1, parent l1, relative /l1/ll1, full /cgroup/cpu///l1/ll1 path lll1, parent ll1, relative /l1/ll1/lll1, full /cgroup/cpu///l1/ll1/lll1 path a, parent , relative /a, full /cgroup/cpu///a path e, parent a, relative /a/e, full /cgroup/cpu///a/e path f, parent e, relative /a/e/f, full /cgroup/cpu///a/e/f path f, parent a, relative /a/f, full /cgroup/cpu///a/f path x, parent a, relative /a/x, full /cgroup/cpu///a/x path b, parent a, relative /a/b, full /cgroup/cpu///a/b path c, parent b, relative /a/b/c, full /cgroup/cpu///a/b/c path d, parent c, relative /a/b/c/d, full /cgroup/cpu///a/b/c/d path default, parent , relative /default, full /cgroup/cpu///default root is /cgroup/cpu//a/ path , parent , relative /, full /cgroup/cpu//a/ path e, parent , relative /e, full /cgroup/cpu//a/e path f, parent e, relative /e/f, full /cgroup/cpu//a/e/f path f, parent , relative /f, full /cgroup/cpu//a/f path x, parent , relative /x, full /cgroup/cpu//a/x path b, parent , relative /b, full /cgroup/cpu//a/b path c, parent b, relative /b/c, full /cgroup/cpu//a/b/c Walking the first 5 nodes root is /cgroup/cpu/// path , parent , relative /, full /cgroup/cpu/// path l3, parent , relative /l3, full /cgroup/cpu///l3 path ll1, parent l3, relative /l3/ll1, full /cgroup/cpu///l3/ll1 path lll1, parent ll1, relative /l3/ll1/lll1, full /cgroup/cpu///l3/ll1/lll1 NOTE: Parent directory is represented by an empty (not NULL) string "". The length of the string is 0. Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@356 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Update specfile for v0.33 and bump up the versionDhaval Giani2009-02-274-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From: Ivana Varekova <varekova@redhat.com> OK, here goes This patch Originally from Ivana and with changes I've made, get the spec file working again (rpmlint warnings need some care and ownership). The new version will be 0.33 and will have new man pages and newer API and many more bug fixes [varekova@redhat.com] Incorporate pam module instalation to the spec file - file part change add dependency [balbir@linux.vnet.ibm.com] Bumped up the version, getting ready for a new release. Updated makefile to install new man pages and to move the pam module to the correct place at the time of installation. Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@355 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup test: Change dbg to cgroup_dbgDhaval Giani2009-02-273-5/+21
| | | | | | | | | | | | | | Since cgroup_dbg is defined on the basis of CGROUP_DBG, we get libcgrouptest.h and libcg_ba.cpp to include config.h and change dbg to cgroup_dbg. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: Sudhir Kumar <skumar@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@354 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Add cgrulesengd man pageDhaval Giani2009-02-272-0/+62
| | | | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> Add cgrulesengd man page and install it on 'make install'. Rebased to lastes trunk and fixed file name. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@353 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* bcgroup: Rename 'flash' to 'reload'Dhaval Giani2009-02-262-4/+4
| | | | | | | | | | | | | | LSB specifies that 'reload' is the right initscript parameter to stimulate daemon to reread its configuration file. I let the 'flash' still working, in case somebody is used to it, but do not advertise it anywhere. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@352 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Start cgred service after cgconfigDhaval Giani2009-02-261-1/+1
| | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> cgred should start after cgconfig service Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@351 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix copyright noticesDhaval Giani2009-02-264-4/+4
| | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> Some pages have wrong year in copyright notice. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@350 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup manpages: Correct project nameDhaval Giani2009-02-265-5/+5
| | | | | | | Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@349 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Install the man pagesDhaval Giani2009-02-261-0/+5
| | | | | | | | | | | | | | | From: Ivana Varekova <varekova@redhat.com> The man pages should be installed so the patch for Makefile (with the last - for now not incorporated man page) Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@348 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Move the man page into the correct locationDhaval Giani2009-02-261-0/+0
| | | | | | | Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@347 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: cgred.conf.5 man pageDhaval Giani2009-02-261-0/+49
| | | | | | | | | | | | | | From: Ivana Varekova <varekova@redhat.com> This is my proposal of cgred.conf man page. There are used some of some parts of present documentation of libcg - again. Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@346 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Rename dbg() to cgroup_dbg()Dhaval Giani2009-02-258-96/+107
| | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> Rename dbg() to cgroup_dbg() everywhere. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@345 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Remove PACKAGE_VERSION from Makefile.inDhaval Giani2009-02-251-2/+1
| | | | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> PACKAGE_VERSION is defined both in config.h and Makefile.in, which results in 'PACKAGE_VERSION redefined' warnings. It should be defined only once, let's say in config.h. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@344 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Include config.hDhaval Giani2009-02-253-0/+3
| | | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> config.h (and therefore definition of CGROUP_DEBUG) should be included where appropriate. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@343 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Move dbg() to libcgroup-internal.hDhaval Giani2009-02-254-9/+14
| | | | | | | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> I think dbg() should be in internal header file and not in the public one. The tools get their own definition of dbg() so they don't need to include library private header. dbg() is defined on three places now, it will make more sense when the sources are distributed to different directories. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@342 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* cgclassify: Update cgclassify man pageDhaval Giani2009-02-251-4/+20
| | | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> Update cgclassify man page to reflect new '-g' parameter. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@341 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* cgclassify: Add -g option to cgclassifyDhaval Giani2009-02-252-28/+98
| | | | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> cgclassify tools currently moves processes to groups only as specified in cgrules.conf. It would be nice to move processes to another group, specified on command line, like cgexec does. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@340 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Move parse_cgroup_data to separate .c fileDhaval Giani2009-02-254-72/+141
| | | | | | | | | | | | | | | | | | From: Jan Safranek <jsafrane@redhat.com> Cgclassify could benefit from parsing of -g command line option, let's move it to separate file, where both cgexec and cgclassify can use it. The data structures and function names are also more descriptive now. I added also the copyright notice and license to the new files. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@339 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Ivana Varekova <varekova@redhat.com>Balbir Singh2009-02-233-15/+11
| | | | | | | | | | | | | This patch fixes spec file handling of daemon parts of libcg (add chkconfig to post and including dependency, fix preun script). And fix the levels in which is this daemon start by default (should not be any). Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@338 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Ivana Varekova <varekova@redhat.com>Balbir Singh2009-02-235-47/+46
| | | | | | | | | | | | | | | | | | This patch changes cgconfig.conf - comment all rows and rename example values - to have example which should be installed to /etc/. Move cgred to /etc/sysconfig and patch spec to install all /etc/* configuration files (at least they shows examples and help to user to do their own configuration).). Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> NOTE: The spec file is still broken due to lack of packaging of pam_cgroup.so. git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@337 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Impact: Fix the parsing issue when two or more values are specifiedBalbir Singh2009-02-212-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes an issue where when two or more values are specified for the controllers, only the last one is applied. This patch fixes that issue. The parser is modified to collate all the name value pairs, seperated by ":". The reason for implementing it this way is because we need to pass the controller name and splitting the rules would make it very hard to pass the controller name to each rule, irrespective of where the controller name was parsed. Tested with the following config file group default { perm { task { uid = root; gid = root; } admin { uid = root; gid = root; } } cpu { cpu.shares = 2048; } cpuset { cpuset.mems=0; cpuset.cpus=0-1; } } mount { cpu = /cgroup/cpu; cpuacct = /cgroup/cpu; cpuset = /cgroup/cpu; } Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@336 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgorup: Fix a chown security issueDhaval Giani2009-02-211-7/+9
| | | | | | | | | | | | | | | | | | | | From: Balbir Singh <balbir@linux.vnet.ibm.com> Impact: Bug fix causes incorrect chown This patch fixes a potential security issue, we free path and add reallocate it using asprintf, but that breaks chown, since that relies on fts_path[0] and path to point to the same address location. Please review, comment. [dhaval@linux.vnet.ibm.com: Fixed the return checks] Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@335 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix return valuesDhaval Giani2009-02-211-4/+11
| | | | | | | | | | | | | | | | | From: Balbir Singh <balbir@linux.vnet.ibm.com> Impact: Bug fix, fix incorrect return values This patch fixes incorrect return value of -1 being returned from some call sites. Please review, comment. printf's are ugly, so they've been converted to dbg. Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@334 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* This is my proposal of cgconfigparser man page. I've used some of some partsBalbir Singh2009-02-171-0/+31
| | | | | | | | | | of present documentation of libcg - again. Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@333 4f4bb910-9a46-0410-90c8-c897d4f1cd53