summaryrefslogtreecommitdiffstats
path: root/src/tools
Commit message (Collapse)AuthorAgeFilesLines
* This patch adds cgset toolIvana Varekova2009-06-182-1/+179
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds cgset tool, which sets parameters of controllers for given cgroup based on input name-variable pairs - the syntax is: cgset -r <name=value> <relative path to cgroup> ------------------------------------------------- EXAMPLES: $ cgcreate -g cpuset:test1 $ cgset -r cpuset.cpus=1 test $ cat ./test/cpuset.cpus 1 $ cgcreate -g cpuset:test1 -g cpuset:test2 $ cgset -r cpuset.cpus=0 test1 test2 $ cat /mnt/cgroups/cpuset/test1/cpuset.cpus 0 $ cat /mnt/cgroups/cpuset/test2/cpuset.cpus 0 Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Cleanup: Integrate similar code to cgroup_get_uid_gid_from_procfs().Ken'ichi Ohmichi2009-06-081-84/+3
| | | | | | | | | | | | | | CHANGELOG of v2.1: ================ * Rebase the patch for commit '340feae163c4797a6cb1247b3812c1ccdc52fa41'. There are some similar functions for getting process's data (uid, gid) from /proc/<pid>/status file, so this patch integrates these functions into one cgroup_get_uid_gid_from_procfs(). Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Reviewed-By: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* This patch adds cgcreate toolIvana Varekova2009-06-032-1/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds cgcreate tool, which creates cgroups based on input parameters - the syntax is: cgcreate -t <tuid>:<tgid> -a <agid>:<auid> -g <list of controllers>:<relative path to cgroup> where: -a enables user to define admin gid and uid (implicit values are the same values which are in the parent directory) -t enables user to define task gid and uid (implicit values are the same values which are in parent directory) -g sets pairs list of controllers-relative path to cgroup ------------------------------------------------- EXAMPLES: * ../../libtool --mode=execute ./cgcreate -a :varekova -g cpuacct:first * ll /mnt/cgroups/cpuacct | grep first drwxrwxr-x 2 root varekova 0 2009-06-03 09:14 first * ll /mnt/cgroups/cpuacct/first/* -rwxrwxr-x 1 root varekova 0 2009-06-03 09:14 /mnt/cgroups/cpuacct/first/cpuacct.usage -rwxrwxr-x 1 root varekova 0 2009-06-03 09:14 /mnt/cgroups/cpuacct/first/notify_on_release -rwxrwxr-x 1 root varekova 0 2009-06-03 09:14 /mnt/cgroups/cpuacct/first/tasks * ../../libtool --mode=execute ./cgcreate -a varekova:root -t varekova:varekova -g cpuacct:second * ll /mnt/cgroups/cpuacct/ | grep second drwxrwxr-x 2 varekova root 0 2009-06-03 09:13 second * ll /mnt/cgroups/cpuacct/second total 0 -rwxrwxr-x 1 varekova root 0 2009-06-03 09:13 cpuacct.usage -rwxrwxr-x 1 varekova root 0 2009-06-03 09:13 notify_on_release -rwxrwxr-x 1 varekova varekova 0 2009-06-03 09:13 tasks * ../../libtool --mode=execute ./cgcreate -a varekova:varekova -g cpuacct:third -g cpuacct:fourth * ll /mnt/cgroups/cpuacct | grep h drwxrwxr-x 2 varekova varekova 0 2009-06-03 09:18 fourth drwxrwxr-x 2 varekova varekova 0 2009-06-03 09:18 third * ll /mnt/cgroups/cpuacct/*h* /mnt/cgroups/cpuacct/fourth: total 0 -rwxrwxr-x 1 varekova varekova 0 2009-06-03 09:18 cpuacct.usage -rwxrwxr-x 1 varekova varekova 0 2009-06-03 09:18 notify_on_release -rwxrwxr-x 1 varekova varekova 0 2009-06-03 09:18 tasks /mnt/cgroups/cpuacct/third: total 0 -rwxrwxr-x 1 varekova varekova 0 2009-06-03 09:18 cpuacct.usage -rwxrwxr-x 1 varekova varekova 0 2009-06-03 09:18 notify_on_release -rwxrwxr-x 1 varekova varekova 0 2009-06-03 09:18 tasks Signed-off-by: Ivana Varekova <varekova@redhat.com>
* Add cgroup_free_group_spec procedureIvana Varekova2009-05-292-0/+32
| | | | | | | | Add cgroup_free_group_spec procedure which free cgroups_group_spec variable. Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* parse_cgroup_spec function does not initializesd allocated memoryIvana Varekova2009-05-291-1/+1
| | | | | | | | | parse_cgroup_spec function does not initializesd allocated memory this patch allocate it to zero so there is no problem with uninitialized values. Signed-off-by: Ivana Varekova <varekova@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Add options to enable/disable various build targets.Jan Safranek2009-05-251-0/+4
| | | | | | | | | | | | | By default, everything is compiled. I want to add options to ./configure, which can selectively disable tools, daemon and pam module. The library itself is mandatory component and cannot be disabled. Usage: ./configure --help ./configure --disable-tools --disable-pam --disable-daemon Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Add fclose() calls into egid_of_pid().Ken'ichi Ohmichi2009-05-181-0/+2
| | | | | | | | | | | | | Hi, This patch adds necessary fclose() calls into egid_of_pid(). Thanks Ken'ichi Ohmichi Reported-by: Masayuki Igawa <igawa@mxs.nes.nec.co.jp> Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Fix of cgexec error handlingIvana Varekova2009-05-081-1/+2
| | | | | | | | | | | Fix of cgexec error handling - with this patch cgexec return the right error message - not only cg internal error value re-generated Signed-off-by: Ivana Varekova <varekova@redhat.com> Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Remove autogenerated files and update documentation. More documentationBalbir Singh2009-04-011-519/+0
| | | | | | updates will be needed and will be done in subsequent cleanups. Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
* Add fclose() calls for error handlingKen'ichi Ohmichi2009-03-311-0/+2
| | | | | | | | | I reviewed the libcgroup code in the viewpoint of memory-leak and found some lacks of fclose(). This patch adds some fclose() calls for error handling. Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* Rework the way how so version is definedJan Safranek2009-03-261-3/+5
| | | | | | | | | Make the shared object version a bit more usable, the notation with double colons cannot be used on different places (see next patch). Also run automake && autoconf to refresh the generated stuff. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Install cgconfigparser to /sbinJan Safranek2009-03-262-21/+53
| | | | | | | | | cgconfigparser can be executed only by root, so it should be installed to /sbin directory. Also run automake to update Makefile.in with this change. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Generate everythingautomakeJan Safranek2009-03-261-0/+486
| | | | | | Finally run autoreconf -f -i to generate all the stuff that should be generated Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Add automake makefilesJan Safranek2009-03-261-0/+11
| | | | | | | | 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>
* Distribute files to various subdirectoriesJan Safranek2009-03-265-0/+557
Signed-off-by: Jan Safranek <jsafrane@redhat.com>