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?

Signed-off-by: Jan Chaloupka <jchal...@redhat.com>
---
 doc/man/cgrules.conf.5 |   14 ++++++++++---
 doc/man/cgrules.d.5    |   50 ++++++++++++++++++++++++++++++++++++++++++++++++
 doc/man/cgrulesengd.8  |   20 ++++++++++++++-----
 3 files changed, 75 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..2d434e7 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 hierarchy 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..76f2255
--- /dev/null
+++ b/doc/man/cgrules.d.5
@@ -0,0 +1,50 @@
+.\" Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
+.\" Written by Jan Chaloupka <jchal...@redhat.com>
+
+.TH CGRULES.D  5 2014-07-14 "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 different <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 among multiple files.
+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 successfully processed rules
+are kept in the cache. With cache disabled,
+matching is stopped and ends with not found result.
+
+If \fB/etc/cgrules.d\fR is empty, \fBcgrulesengd\fR (8) acts as being
+in a back compatibility mode.
+
+.SH FILES
+.LP
+.PD .1v
+.TP 20
+.B /etc/cgrules.d
+.RS 4
+default libcgroup configuration files directory
+.RE
+.B /etc/cgconfig.conf
+.RS 4
+default libcgroup configuration file
+.RE
+.PD .
+
+
+.SH SEE ALSO
+cgconfig.conf (5), cgrulesengd (8)
diff --git a/doc/man/cgrulesengd.8 b/doc/man/cgrulesengd.8
index 749b6fc..ba654b9 100644
--- a/doc/man/cgrulesengd.8
+++ b/doc/man/cgrulesengd.8
@@ -10,10 +10,11 @@ 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 +68,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)


------------------------------------------------------------------------------
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&#174;
Code Sight&#153; - 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

Reply via email to