summaryrefslogtreecommitdiffstats
path: root/extras/init.d
diff options
context:
space:
mode:
authorFilip Pytloun <filip.pytloun@gooddata.com>2012-12-10 14:41:10 +0100
committerAnand Avati <avati@redhat.com>2012-12-12 07:36:26 -0800
commit6d58cb0476dc13198596603a9efd5014ebcb0c45 (patch)
tree926b553bf504770cdf80b4edb47a35341fbcfd61 /extras/init.d
parentfef94c2acffc15159a1d5428c2f6c3b1a1bbee10 (diff)
RHEL init script: ability to overwrite options from sysconfig
Change-Id: I15df0aef73e097a9ccfb00e2d4cae81d3a5a82fc BUG: 885739 Signed-off-by: Filip Pytloun <filip.pytloun@gooddata.com> Reviewed-on: http://review.gluster.org/4290 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'extras/init.d')
-rwxr-xr-xextras/init.d/glusterd-Redhat.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/extras/init.d/glusterd-Redhat.in b/extras/init.d/glusterd-Redhat.in
index c260ca0cf37..5c92a4474a8 100755
--- a/extras/init.d/glusterd-Redhat.in
+++ b/extras/init.d/glusterd-Redhat.in
@@ -10,10 +10,21 @@
BASE=glusterd
PIDFILE=/var/run/$BASE.pid
PID=`test -f $PIDFILE && cat $PIDFILE`
+
+# Overwriteable from sysconfig
+LOG_LEVEL=''
+LOG_FILE=''
+GLUSTERD_OPTIONS=''
+
+[ -f /etc/sysconfig/${BASE} ] && . /etc/sysconfig/${BASE}
+
+[ ! -z $LOG_LEVEL ] && GLUSTERD_OPTIONS="${GLUSTERD_OPTIONS} --log-level ${LOG_LEVEL}"
+[ ! -z $LOG_FILE ] && GLUSTERD_OPTIONS="${GLUSTERD_OPTIONS} --log-file ${LOG_FILE}"
+
GLUSTERFSD=glusterfsd
GLUSTERFS=glusterfs
GLUSTERD_BIN=@prefix@/sbin/$BASE
-GLUSTERD_OPTS="--pid-file=$PIDFILE"
+GLUSTERD_OPTS="--pid-file=$PIDFILE ${GLUSTERD_OPTIONS}"
GLUSTERD="$GLUSTERD_BIN $GLUSTERD_OPTS"
RETVAL=0