From 6120aaccbda0e369d8fa390bdd4e2c20bb014fe8 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 15 Nov 2010 14:59:52 +0100 Subject: [PATCH] Update initscript with new socket user and group options Add a posibility to set socker owner to init scripts. Signed-off-by: Jan Safranek Signed-off-by: Dhaval Giani --- samples/cgred.conf | 5 +++++ scripts/init.d/cgred.in | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/samples/cgred.conf b/samples/cgred.conf index 6acbf79e..48028793 100644 --- a/samples/cgred.conf +++ b/samples/cgred.conf @@ -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="" diff --git a/scripts/init.d/cgred.in b/scripts/init.d/cgred.in index ba89aee2..c05ddf0d 100644 --- a/scripts/init.d/cgred.in +++ b/scripts/init.d/cgred.in @@ -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 -- 2.47.2