Add new command line options to sample config file

Signed-off-by: Jan Safranek <[email protected]>
Acked-by: Dhaval Giani <[email protected]>
---

 samples/cgred.conf   |   13 ++++++++-----
 scripts/init.d/cgred |    5 ++++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/samples/cgred.conf b/samples/cgred.conf
index 5363be5..14209e5 100644
--- a/samples/cgred.conf
+++ b/samples/cgred.conf
@@ -1,19 +1,22 @@
 # /etc/cgred.d/cgred.conf - CGroup Rules Engine Daemon configuration file
 # 
-# The four options listed below (CONFIG_FILE, LOG_FILE, NODAEMON, NOLOG) are
+# The four options listed below (CONFIG_FILE, LOG_FILE, NODAEMON, LOG) are
 # the only valid ones.  Defining anything else in this file will cause the
 # CGroup Rules Engine program to fail.  So, don't do it.
 
 # The pathname to the configuration file for CGroup Rules Engine
 CONFIG_FILE="/etc/cgrules.conf"
 
-# The pathname to the log file for CGroup Rules Engine
-LOG_FILE="/root/cgrulesengd.log"
+# Uncomment the following line to log to specified file instead of syslog
+#LOG_FILE="/var/log/cgrulesengd.log"
 
 # Uncomment the second line to run CGroup Rules Engine in non-daemon mode
 NODAEMON=""
 #NODAEMON="--nodaemon"
 
 # Uncomment the second line to disable logging for CGroup Rules Engine
-NOLOG=""
-#NOLOG="--nolog"
+# Uncomment the third line to enable more verbose logging.
+LOG=""
+#LOG="--nolog"
+#LOG="-v"
+
diff --git a/scripts/init.d/cgred b/scripts/init.d/cgred
index ee9fc40..f0eebc4 100644
--- a/scripts/init.d/cgred
+++ b/scripts/init.d/cgred
@@ -50,7 +50,10 @@ CGRED_BIN=${exec_prefix}/${bindir}/cgrulesengd
 # Read in configuration options.
 if [ -f "/etc/cgred.d/cgred.conf" ] ; then
        . /etc/cgred.d/cgred.conf
-       OPTIONS="--log $LOG_FILE $NODAEMON $NOLOG"
+       OPTIONS="$NODAEMON $LOG"
+       if [ -n "$LOG_FILE" ]; then
+               OPTIONS="$OPTIONS --log-file=$LOG_FILE"
+       fi
 else
        OPTIONS=""
 fi


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to