From 6d58cb0476dc13198596603a9efd5014ebcb0c45 Mon Sep 17 00:00:00 2001 From: Filip Pytloun Date: Mon, 10 Dec 2012 14:41:10 +0100 Subject: RHEL init script: ability to overwrite options from sysconfig Change-Id: I15df0aef73e097a9ccfb00e2d4cae81d3a5a82fc BUG: 885739 Signed-off-by: Filip Pytloun Reviewed-on: http://review.gluster.org/4290 Reviewed-by: Niels de Vos Tested-by: Niels de Vos --- extras/init.d/glusterd-Redhat.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'extras/init.d/glusterd-Redhat.in') diff --git a/extras/init.d/glusterd-Redhat.in b/extras/init.d/glusterd-Redhat.in index c260ca0cf..5c92a4474 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 -- cgit