From: Ivana H. V. <var...@us...> - 2014-07-31 09:29:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "This is the main upstream repository of the libcgroup project. All releases". The branch, master has been updated via 8012db9e81afc68f3e74dfe42e0d7ed0c1aa442c (commit) via f0356d97e69f0eb993e72b38829c91e10b927a4a (commit) from 1cf69a968c753b42d7cf816f129a2962f5f87a2a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8012db9e81afc68f3e74dfe42e0d7ed0c1aa442c Author: Jan Chaloupka <jch...@re...> Date: Thu Jul 31 11:23:08 2014 +0200 cgrules.d: new man page This patch contains new man page for cgrules.d directory and corresponding update of existing man pages. It describes the way additional configuration files should be created and potential conflicts resulting from an arbitrary order or reading files in the directory. Changelog: * line wrapping (max to 80 characters) * hiearchy typo corrected * diffrent typo corrected * succesfully typo corrected * /etc/cgconfig.conf added into FILES section * formulation of advice for creating rules updated. Is it enough or still confusing? If so, can you be more specific? * reformulation of the first and the second paragraph Signed-off-by: Jan Chaloupka <jch...@re...> Acked-by: Ivana Hutarova Varekova <var...@re...> commit f0356d97e69f0eb993e72b38829c91e10b927a4a Author: Jan Chaloupka <jch...@re...> Date: Thu Jul 31 11:21:19 2014 +0200 api.c: Adding support for loading configuration files from cgrules.d directory Implementation of loading rules from /etc/cgrules.d/. Explanation is in the cover letter. New function cgroup_parse_rules_file created, calling cgroup_parse_rules. cgroup_parse_rules is invoked only in cgroup_change_cgroup_flags, cgroup_init_rules_cache and cgroup_reload_cached_rules functions. For them the change in cgroup_parse_rules implementation is transpart. Tested with two configuration files in /etc/cgrules.d/ and all rules in /etc/cgrules.conf commented out: $ cat /etc/cgrules.conf #*:ls cpu strom/%u #*:sleep memory les/%g $ cat /etc/cgrules.d/cgrules1.conf *:ls cpu strom/%u $ cat /etc/cgrules.d/cgrules2.conf *:sleep memory les/%g plus cgconfig.[c|d/*] files: $ cat /etc/cgconfig.conf mount { cpuset = /cgroup/cpuset; cpu = /cgroup/cpu; cpuacct = /cgroup/cpuacct; memory = /cgroup/memory; devices = /cgroup/devices; freezer = /cgroup/freezer; net_cls = /cgroup/net_cls; blkio = /cgroup/blkio; } $ cat /etc/cgconfig.d/small.conf template strom/%u { cpu {} } group vetev { cpu {} } $ cat /etc/cgconfig.d/medium.conf template les/%g { memory {} } group drevo/listi { memory {} } Tested to cache reload as well by sending SIGUSR2 signal to running cgrulesengd process. After first reload I commented out all rules => no rules match after invoking ls command. After second reload I uncommented out ls rule => rule match after invoking ls command. After third reload I uncommented out ls and sleep rule => debug output of cgrulesengd shows both rules loaded in the cache Changelog: * CGROUP_PARSE_STATE_UNLOCK removed * reformulation of comment to "Cannot read directory. However, CGRULES_CONF_FILE is succesfully parsed. Thus return as a success for back compatibility." * errno = 0 removed, once it is not zero, function returns, so need to set it to 0 in every iteration * fprintf replaced by cgroup_err * added missing unlocks + new label unlock_list for all returns This - * finds a rule matching the given UID or GID. It will store this rule in rl, + * finds a rule matching the given UID or GID. It will store this rule in trl, is valid correction. "It will store this rule in rl" talks about cache being disabled. In this case, it is stored into trl. Signed-off-by: Jan Chaloupka <jch...@re...> Acked-by: Ivana Hutarova Varekova <var...@re...> ----------------------------------------------------------------------- Summary of changes: doc/man/cgrules.conf.5 | 14 +++- doc/man/cgrules.d.5 | 50 ++++++++++++++ doc/man/cgrulesengd.8 | 20 ++++-- src/api.c | 159 ++++++++++++++++++++++++++++++++++++++++++---- src/libcgroup-internal.h | 1 + 5 files changed, 223 insertions(+), 21 deletions(-) create mode 100644 doc/man/cgrules.d.5 hooks/post-receive -- This is the main upstream repository of the libcgroup project. All releases |