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.

Signed-off-by: Jan Chaloupka <jchal...@redhat.com>
---
 doc/man/cgrules.conf.5 |   14 ++++++++++----
 doc/man/cgrules.d.5    |   30 ++++++++++++++++++++++++++++++
 doc/man/cgrulesengd.8  |   19 ++++++++++++++-----
 3 files changed, 54 insertions(+), 9 deletions(-)
 create mode 100644 doc/man/cgrules.d.5

diff --git a/doc/man/cgrules.conf.5 b/doc/man/cgrules.conf.5
index 7a89fb5..51ec89a 100644
--- a/doc/man/cgrules.conf.5
+++ b/doc/man/cgrules.conf.5
@@ -85,7 +85,7 @@ configuration file. See (\fBcgconfig.conf\fR (5)).
 If the template definition is not found there created group have default
 kernel setting.
 
-
+To create a hiearchy of configuration files, use \fB/etc/cgrules.d\fR 
directory.
 
 .SH EXAMPLES
 .nf
@@ -136,13 +136,19 @@ process.
 .PD .1v
 .TP 20
 .B /etc/cgrules.conf
-.TP
+.RS 6
 default libcgroup configuration file
-.PD .
+.RE
+.TP 20
+.B /etc/cgrules.d
+.RS 6
+default libcgroup configuration files directory
+.RE
+.PD
 
 
 .SH SEE ALSO
-cgconfig.conf (5), cgclassify (1), cgred.conf (5)
+cgconfig.conf (5), cgclassify (1), cgred.conf (5), cgrules.d (5)
 
 .SH BUGS
 
diff --git a/doc/man/cgrules.d.5 b/doc/man/cgrules.d.5
new file mode 100644
index 0000000..6ea3a45
--- /dev/null
+++ b/doc/man/cgrules.d.5
@@ -0,0 +1,30 @@
+.\" Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
+.\" Written by Jan Chaloupka <jchal...@redhat.com>
+
+.TH CGRULES.D  5 2014-07-04 "Linux" "libcgroup Manual"
+.SH NAME
+cgrules.d \- libcgroup configuration files directory
+.SH DESCRIPTION
+.B "cgrules.d"
+configuration files directory is used by
+.B libcgroups
+and contains additional configuration files with the same syntax as 
\fBcgconfig.conf\fR (5).
+
+Because the order of parsing of configuration files is not determined, files 
can be parsed in an arbitrary order. A searching algorithm of \fBcgrulesengd\fR 
(8) with cache disabled tries to find the first match. Having two files with 
one rule each with the same <user>[:<process name>] prefix but diffrent 
<controllers> or <destination> parts, it is not determined, which rule is going 
to be matched first. Thus create such configuration files that don't have rules 
with the same <user>[:<process name>] prefix. Unless all those rules are in the 
same file.
+
+\fB/etc/cgconfig.conf\fR is parsed as the first file. After success, all files 
from /etc/cgconfig.d are parsed as well (in arbitrary order). If some file from 
the directory ends up with a parsing error, the process is stopped. With cache 
enabled, all succesfully processed rules are kept in the cache. With cache 
disabled, matching is stopped and ends with not found result.
+
+If /etc/cgconfig.d is empty, \fBcgrulesengd\fR (8)
+
+.SH FILES
+.LP
+.PD .1v
+.TP 20
+.B /etc/cgrules.d
+.TP
+default libcgroup configuration files directory
+.PD .
+
+
+.SH SEE ALSO
+cgconfig.conf (5), cgrulesengd (8)
diff --git a/doc/man/cgrulesengd.8 b/doc/man/cgrulesengd.8
index 749b6fc..b10557b 100644
--- a/doc/man/cgrulesengd.8
+++ b/doc/man/cgrulesengd.8
@@ -10,10 +10,10 @@ cgrulesengd \- control group rules daemon
 .SH DESCRIPTION
 \fBcgrulesengd\fR is a daemon, which distributes processes to control groups. 
When
 any process changes its effective UID or GID, \fBcgrulesengd\fR inspects the 
list
-of rules loaded from the \fIcgrules.conf\fR file and moves the process to
-the appropriate control group.
+of rules loaded from the \fIcgrules.conf\fR file and files in \fIcgrules.d\fR 
(see \fBcgrules.d\fR (5) for potential conflicts) directory
+and moves the process to the appropriate control group.
 
-The list of rules is read during the daemon startup is are cached in the 
daemon's memory.
+The list of rules is read during the daemon startup and cached in the daemon's 
memory.
 The daemon reloads the list of rules when it receives SIGUSR2 signal.
 The daemon reloads the list of templates when it receives SIGUSR1 signal.
 
@@ -67,14 +67,23 @@ controls verbosity of the tool. Allowed values are 
\fBDEBUG\fR,
 .PD .1v
 .TP
 .B /etc/cgrules.conf
-.TP
+.RS 6
 the default libcgroup configuration file
+.RE
+.B /etc/cgrules.d
+.RS 6
+the default libcgroup configuration files directory
+.RE
 .TP
 .B /etc/cgconfig.conf
+.RS 6
 the default templates file
+.RE
 .TP
 .B /etc/cgconfig.d/
+.RS 6
 the default templates directory
+.RE
 
 .SH SEE ALSO
-cgrules.conf (5)
+cgrules.conf (5), cgrules.d (5)


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to