summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libcgroup: Segfault when we run setuid testcase without argumentDhaval Giani2008-12-141-0/+5
| | | | | | | | | | | | | | | From: "Rishikesh K. Rajak" <risrajak@linux.vnet.ibm.com> In libcgroup testcase "setuid" testcase segfault when we run without uid parameter. This patch fixes the issue. [dhaval@linux.vnet.ibm.com: Minor fixes] Signed-off-by: Rishikesh k Rajak <risrajak@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@235 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Better error reporting for libcgroupDhaval Giani2008-12-094-2/+45
| | | | | | | | | | | | | | | | From: Ankita Garg <ankita@in.ibm.com> This patch adds human readable error messages to the configuration parser. The error lookup is implemented as a simple table, indexed by the error. TODO: Save errno at ECGOTHER and pass it down as cgroup_lasterror. Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Ankita Garg <ankita@in.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@228 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Improve parameter checking and usage in cgconfigparserDhaval Giani2008-12-091-9/+24
| | | | | | | | | | | | | | | | From: Sripathi Kodi <sripathik@in.ibm.com> The following patch improves cgconfigparser's parameter checking and usage(). It provides: 1) Support for long options. Not really needed now, but good to have. 2) Improved usage() functionality. Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@227 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: SanjayKumar J <vjsanjay@gmail.com>Balbir Singh2008-12-012-3/+3
| | | | | | | | | | | | | | Consistent Error checking for group_admin_perm Signed-off-by: SanjayKumar J <vjsanjay@gmail.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> [Balbir - change prefix in Makefile to /usr, so that make install does sensible things] git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@226 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Auto generated documentationDhaval Giani2008-11-261-0/+246
| | | | | | | | | | | | This patch provides a doxyfile and allows doxygen to generate useful documentation from code. Please review! Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: Dhaval Giani <dhaval@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@225 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Compile pam_cgroup.so by defaultDhaval Giani2008-11-262-2/+2
| | | | | | | | | | | | The PAM module was not getting compiled while doing a make. Correct that. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@224 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Bug fix in libcgroup wrapper apiDhaval Giani2008-11-181-0/+4
| | | | | | | | | | | | | From: Sudhir Kumar <skumar@linux.vnet.ibm.com> The issue no 2309126 reported on sf.net tracker is fixed by this patch. This patch fixes a segmentation fault in cgroup_free_controllers() wrapper, which is generated when a Null cgroup is passed to the wrapper. Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@222 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Make cgconfigparser more verboseDhaval Giani2008-11-101-1/+3
| | | | | | | | | | | | | | As per http://sourceforge.net/tracker/?func=detail&atid=1043649&aid=2128139&group_id=218421 cgconfigparser was not exiting silently for wrong usage. Let's let the user know they are using wrong syntax. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Tested-by: Sudhir Kumar <sudhir@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@221 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Minor release v0.32.1Dhaval Giani2008-10-232-2/+2
| | | | | | | | | | Some minor fixes to the Makefile and other fixes by Balbir. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@218 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Merge several bug-fixes and cleanups. No version bump yet, since this isBalbir Singh2008-10-159-47/+121
| | | | | | | | | | an ongoing exercise (after more testing, I'll recommend one). Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@216 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix makefile entry for cgconfigparserDhaval Giani2008-10-101-1/+1
| | | | | | | | Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@213 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: v0.32Dhaval Giani2008-09-303-11/+11
| | | | | | | Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@204 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: ABI guaranteeDhaval Giani2008-09-303-7/+51
| | | | | | | | | | | | | | | | | From: Balbir Singh <balbir@linux.vnet.ibm.com> Versioning all the symbols, in order to provide ABI guarantee. Bringing Balbir's patch up to date, and changing the version to 0.32. Please review. [dhaval@linux.vnet.ibm.com: updated with latest symbols] 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@203 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Change how cgroup_get_cgroup worksDhaval Giani2008-09-292-14/+26
| | | | | | | | | | | | | | Since we will not deprecate API now, and will do so with the next release, let's include this one in and get the API right. With this pathc, we now return int type, and the pointer passed as the argument redirects to the cgroup we are reading. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@202 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Configuration rewrite to use the main cgroups API and several bug fixesBalbir Singh2008-09-2910-844/+480
| | | | | | | | | | | | | and configuration enhancements. Primarliy Initiated by Dhaval Giani Please see svn log of all branches/balbir-config-cleanup 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@201 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* The automatic classification engine (cgexec, cgclassify, pam_cgroup)Balbir Singh2008-09-295-1/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | classify tasks. It is useful for an application to know where it has been classified. I propose to add a new API cgroup_get_current_controller_path() that returns the current classification directory for the specified controller. One can easily add on and build new API that will return paths of all mounted controllers, but I want to start with something simple and useful. I've also added a bunch of test cases for the same purpose. Test output # ./pathtest.sh Test FAIL, get path failed for controller cpuset Test PASS, controller cpu path /default Test PASS, controller cpuacct path /default Test PASS, controller memory path /default Test FAIL, get path failed for controller memrlimit I mounted just cpu, cpuacct and memory, thus the path for cpuset and memrlimit could not be found (as expected). Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Reviewed-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@200 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Merge the cgruleseng daemon from Steve OlivieriBalbir Singh2008-09-2612-196/+1906
| | | | | | | | | | Signed-off-by: Steve Olivieri <sjo@redhat.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@190 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Once we build the path, we don't have all the room in path anymore.Balbir Singh2008-09-201-2/+4
| | | | | | | | | | | | Instead of using sizeof(path), we should use FILENAME_MAX - strlen(path) - 1. Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@186 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Fix a warning in api.c, where we ignore the fscanf value.Balbir Singh2008-09-201-1/+6
| | | | | | | | | | | I've tested the patch by running the tests available in the tests directory. Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@185 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Check for NULL data structures in the wrappersDhaval Giani2008-09-051-0/+42
| | | | | | | | | | | Don't want to have a segmentation fault for NULL data structures. Just return an error to the caller. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@177 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Change variables to *printf/*scanf to use inttypes.hDhaval Giani2008-09-051-7/+7
| | | | | | | | | | | | | | | Instead of using %lu and so on, use the inttype.h macro to define types. Will ensure compatibility across platforms. Please review more closely. Tested by compiling with and without -m32 on a 64 bit system. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@176 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix makefile entry for cgclassifyDhaval Giani2008-09-051-4/+4
| | | | | | | | | | | | cgclassify depends on libcgroup.so. Ensure that the dependency is met. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@175 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix makefile entry for make cleanDhaval Giani2008-08-271-1/+1
| | | | | | | | | | | | | Don't know when this change happened, or got missed. Correcting it now. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Cc: Vivek Goyal <vgoyal@redhat.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@171 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: bump up version to 0.31Dhaval Giani2008-08-263-12/+17
| | | | | | | Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@169 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* More fixes to the earlier attempt to create new cgroup inheriting parent'sBalbir Singh2008-08-222-21/+80
| | | | | | | | | | | attributes. Test cases have also been updated. Tested on an x86_64 box with libcg_ba Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@166 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* This patch adds cgroup_create_cgroup_from_parent() API. I've tested itBalbir Singh2008-08-224-22/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with a modified version of libcg_ba (basic acceptance tests), that I'll send out later. I've also fixed a couple of bugs, I'll list them in order and if desired, I'll split out the patches so that the enhancements can be separate from the bug fixes 1. Fix cg_create_control_group() to succeed if the directory already exists 2. We can't always append a control_file, we need to open it "r+" 3. It's OK for writing values to a control_file to fail, since some of them are read-only and some may not exist in hierarchies below the root 4. Skip over directories while trying to read control file's name value pairs 5. In cg_rd_ctlr_file we don't allocate any memory to value, directly fscanf into it, that's been fixed 6. There might be more fixes that might already be present in trunk, since I hope I've not redone a lot of the fixes, I had branched of trunk very recently Changelog v2 ------------ 1. Refactor cgroup_free_controllers() and use it in cgroup_create_cgroup_from_parent() 2. Check for strdup failure 3. Check if dst == src TODO: 1. Use cg_add_controller() API 2. Use cg_add_value_string() API I'll send out patches for the TODOs later. I've also updated the basic acceptance test (libcg_ba.cpp) Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@165 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: A simple pam module (pam_cgroup.so) for task placement in right ↵Dhaval Giani2008-08-153-5/+188
| | | | | | | | | | | | | | | | | | | | | | | cgroup From: Vivek Goyal <vgoyal@redhat.com> o A simple pam module pam_cgroup for placement of tasks in right cgroup. Details are available in documentation. o This pam module will be included in libcgroup source and not in pam sources. o Copyright notice looks little odd as I copied the original copyright notice of pam_limits.c. Any suggestions for improvement are welcome. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@162 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup testcases: fix small testcase issueDhaval Giani2008-08-151-1/+1
| | | | | | | | | | | | | | From: Sudhir Kumar <skumar@linux.vnet.ibm.com> This patch fixes a small mistake in the testcase where we were comparing string values like integers. Signed-off-by: Sudhir Kumar <skumar@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@161 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Some cgexec cleanupsDhaval Giani2008-08-151-6/+2
| | | | | | | | | | | | From: Vivek Goyal <vgoyal@redhat.com> cgexec cleanup based on balbir's feedback. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@160 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Some libcgroup API cleanupsDhaval Giani2008-08-153-12/+15
| | | | | | | | | | | Various libcgroup api cleanups as suggested by balbir during code review Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@159 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Add up missing scripts/samplesDhaval Giani2008-08-154-0/+209
| | | | | | | | | | | | | From: Balbir Singh <balbir@linux.vnet.ibm.com> Dhaval missed a few files while adding files to the reporsitory. Adding them in now. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@158 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Move trunk to v0.3Dhaval Giani2008-08-143-17/+26
| | | | | | | | Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@156 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix up Makefile.in so that we don't lose testsDhaval Giani2008-08-141-0/+3
| | | | | | | Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@155 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix cgroup_fill_cgc()Dhaval Giani2008-08-141-1/+1
| | | | | | | | | | | We were failing on stat's success. Stupid thing to do really. Fixing that now. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@154 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix return values in cgroup_attach_valueDhaval Giani2008-08-141-0/+4
| | | | | | | | | | | cgroup_attach_task_pid() should return ECGROUPNOTEXIST when we get an ENOENT from glibc. This patch makes that correction Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@153 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Fix configuration assert when multiple controllers are enabledDhaval Giani2008-08-141-1/+1
| | | | | | | | | | | | | | | Since we support multiple controllers, asserting is no longer a good idea. TODO: Support other controllers, memory, cpu and cpuacct (possibly cpusets as well). Well, this code is obsolete and will be replaced by the newer cgroup API. 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@152 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: beautify strcpy in modify_cgroupDhaval Giani2008-08-141-5/+5
| | | | | | | | | The code looked ugly. De-uglyfy it. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@151 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix up some free errorsDhaval Giani2008-08-141-3/+3
| | | | | | | | | | | | | | Sudhir reported a free() issue, it got traced to this issue. https://sourceforge.net/tracker/index.php?func=detail&aid=2049822&group_id=218421&atid=1043649 Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Cc: Sudhir Kumar <skumar@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@150 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Add a mktarball-trunk scriptDhaval Giani2008-08-141-0/+36
| | | | | | | | | | This script allows a tarball of the current trunk to be generated. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@147 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix cgroup_modify_cgroupDhaval Giani2008-08-141-3/+5
| | | | | | | | | | | | An almost unused and less tested API. The path was getting misformed. This was because it had not been set in the first place. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@146 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix the delete APIDhaval Giani2008-08-141-0/+5
| | | | | | | | | | | | | | | | The delete call was returning a wrong value even on success. The reason was because in the fallback path, we try to delete all the groups again. Now it is possible that a group might have already been deleted and we return a wrong value. Change the API to check if the group exists before trying to rmdir it in the error path. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@145 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Ensure null is returned if cgroup does not exist in ↵Dhaval Giani2008-08-141-0/+4
| | | | | | | | | | cgroup_get_cgroup() Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@143 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: zero out allocated memoryDhaval Giani2008-08-141-27/+25
| | | | | | | | | | | | | Use calloc to allocate memory. Should get rid of a number of silent memory corruptions. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Dan Smith <danms@us.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@142 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Sample configuration filesDhaval Giani2008-08-141-7/+27
| | | | | | | | | | | | From: Balbir Singh <balbir@linux.vnet.ibm.com> Dhaval forgot to add these files while merging the code. Merging them in now. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@140 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Change compiler to GCCDhaval Giani2008-08-142-2/+2
| | | | | | | | | | For some reason these changes got lost. Making the change again. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@139 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* cgclassify: A command line tool to classify/re-classify already running taskDhaval Giani2008-08-132-3/+156
| | | | | | | | | | | | | | | | | | | | | | | From: Vivek Goyal <vgoyal@redhat.com> o cgclassify, a command line tool to put a list of pids to the right cgroup based on rules in /etc/cgrules.conf. It can be mainly used for reclassification of tasks which are already running. Can think of two use cases. - During initial bootup, after cgroups are mounted, one needs to move tasks (started beofore cgroups were mounted) into right cgroup. - Once can choose to reclassify the tasks if admin has changed the rules and thinks a group of tasks should reclassified based on new rules. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@138 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* cgexec: A command line tool to execute a task in a cgroupDhaval Giani2008-08-132-3/+201
| | | | | | | | | | | | | | From: Vivek Goyal <vgoyal@redhat.com> o cgexec, a command line tool for placing the task in right cgroup in advance so that no help is needed from rules daemon and user can avoid delay in execution of rules. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@137 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: New API interfaces for task placementDhaval Giani2008-08-134-0/+404
| | | | | | | | | | | | | | | | | | | | | | | From: Vivek Goyal <vgoyal@redhat.com> Enhancement to libcg to do following. - Parse the /etc/cgrules.conf file and place the task in the right cgroup. - Exported two APIs which can place the task based on /etc/cgrules.conf or based on cgroup explicitly specified by the caller. - There can be multiple users. - PAM module (pam_cgroup) - cgexec tool - cgclassify tool - APIs can be directly used by other cgroup aware user progarams. - Classification daemon Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@136 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: documentationDhaval Giani2008-08-131-0/+168
| | | | | | | | Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@135 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Configuration and parsing updates (v2)Dhaval Giani2008-08-136-48/+58
| | | | | | | | | | | | | | | | | | | | | Dhaval, wanted a patch with -p1 generated so that he can apply it and use it with quilt. Here goes Testing Tested with samples/cgconfig.conf (NOTE: expects user balbir to be present on the system, feel free to change and test). TODO 1. Add hooks for other controllers, namely memory, cpuacct and cpuset 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@134 4f4bb910-9a46-0410-90c8-c897d4f1cd53