]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Update initscript with new socket user and group options
authorJan Safranek <jsafrane@redhat.com>
Mon, 15 Nov 2010 13:59:52 +0000 (14:59 +0100)
committerDhaval Giani <dhaval.giani@gmail.com>
Tue, 16 Nov 2010 15:39:16 +0000 (16:39 +0100)
Add a posibility to set socker owner to init scripts.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
samples/cgred.conf
scripts/init.d/cgred.in

index 6acbf79edf0aebdc726c572a865f8c54336aec74..48028793bdbee2a185494cc7a7118dabc77fa281 100644 (file)
@@ -14,6 +14,11 @@ CONFIG_FILE="/etc/cgrules.conf"
 NODAEMON=""
 #NODAEMON="--nodaemon"
 
+# Set owner of cgred socket. 'cgexec' tool should have write access there
+# (either using suid and/or sgid permissions or Linux capabilities).
+SOCKET_USER=""
+SOCKET_GROUP="cgred"
+
 # Uncomment the second line to disable logging for CGroup Rules Engine
 # Uncomment the third line to enable more verbose logging.
 LOG=""
index ba89aee29f3af9e8ab07abb51a326e3cbecaf513..c05ddf0d2e5af92dba8b8e26fe9062c49f7cabd7 100644 (file)
@@ -50,6 +50,12 @@ if [ -f "/etc/sysconfig/cgred.conf" ] ; then
        if [ -n "$LOG_FILE" ]; then
                OPTIONS="$OPTIONS --log-file=$LOG_FILE"
        fi
+       if [ -n "$SOCKET_USER" ]; then
+               OPTIONS="$OPTIONS -u $SOCKET_USER"
+       fi
+       if [ -n "$SOCKET_GROUP" ]; then
+               OPTIONS="$OPTIONS -g $SOCKET_GROUP"
+       fi
 else
        OPTIONS=""
 fi