If CGROUP_LOGLEVEL=DEBUG environment variable is set, enable --debug verbosity
level in the cgrulesengd daemon.

Signed-off-by: Peter Schiffer <pschi...@redhat.com>
---
 src/daemon/cgrulesengd.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c
index d3613ca..1e2a7c9 100644
--- a/src/daemon/cgrulesengd.c
+++ b/src/daemon/cgrulesengd.c
@@ -1027,6 +1027,18 @@ int main(int argc, char *argv[])
                goto finished;
        }
 
+       /*
+        * Check environment variable CGROUP_LOGLEVEL. If it's set to DEBUG,
+        * set appropriate verbosity level.
+        */
+       char *level_str = getenv("CGROUP_LOGLEVEL");
+       if (level_str != NULL) {
+               if (cgroup_parse_log_level_str(level_str) == CGROUP_LOG_DEBUG) {
+                       verbosity = 4;
+                       logp = "-";
+               }
+       }
+
        while (1) {
                int c;
 


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to