This series of patches implements loading of configuration files from /etc/cgrules.d directory. First, /etc/cgrules.conf is parsed. After successful parse, files from /etc/cgrules.d directory are parsed. Because these files can be read in an arbitrary order, attention to rules in these files must be taken. Potential conflicts are explained in cgrules.d (5) man page in the second patch. In a case of missing or empty /etc/cgrules.d directory, /etc/cgrules.conf is still parsed. Thus honouring a back compatibility. Original cgroup_parse_rules function has the same signature. Only its description is modified. New function cgroup_parse_rules_file is presented. Its body is identical to the original cgroup_parse_rules, except to removing cache erasing and locking mechanism, which has been moved back to cgroup_parse_rules. cgroup_parse_rules consists of a call to cgroup_parse_rules with CGRULES_CONF_FILE file (back compatibility) plus opening and reading of files from CGRULES_CONF_DIR directory. ---
Jan Chaloupka (2): api.c: Adding support for loading configuration files from cgrules.d directory cgrules.d: new man page 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 -- Jan Chaloupka ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel