From: Florian Forster Date: Thu, 30 May 2013 06:26:09 +0000 (+0200) Subject: contrib/redhat/init.d-collectd: Rename variable to …PIDDIR. X-Git-Tag: collectd-5.4.0~33 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b5c2af0c579603aa731550cdc4ea0ac1aa1be5d3;p=collectd.git contrib/redhat/init.d-collectd: Rename variable to …PIDDIR. Github: #298 --- diff --git a/contrib/redhat/init.d-collectd b/contrib/redhat/init.d-collectd index 52bf7433..abdb168f 100644 --- a/contrib/redhat/init.d-collectd +++ b/contrib/redhat/init.d-collectd @@ -18,16 +18,16 @@ prog="collectdmon" service="collectd" CONFIG=/etc/collectd.conf COLLECTD=/usr/sbin/collectd -COLLECTDMONPIDIR="/var/run" -COLLECTDMONPID="$COLLECTDMONPIDIR/collectdmon.pid" +COLLECTDMONPIDDIR="/var/run" +COLLECTDMONPID="$COLLECTDMONPIDDIR/collectdmon.pid" if [ -r /etc/sysconfig/$service ]; then . /etc/sysconfig/$service fi -if [ ! -d $COLLECTDMONPIDIR ]; then - mkdir -p $COLLECTDMONPIDIR - [ -n "${RUNAS-}" ] && chown $RUNAS: $COLLECTDMONPIDIR +if [[ ! -d $COLLECTDMONPIDDIR ]]; then + mkdir -p $COLLECTDMONPIDDIR + [ -n "${RUNAS}" ] && chown "${RUNAS}:" "$COLLECTDMONPIDDIR" fi check_config() { @@ -50,7 +50,7 @@ start () { echo $"not starting due to configuration error" failure $"not starting $service due to configuration error" else - daemon --user "${RUNAS-root}" $prog -P $COLLECTDMONPID -c $COLLECTD -- -C "$CONFIG" $ARGS + daemon --user "${RUNAS:-root}" $prog -P $COLLECTDMONPID -c $COLLECTD -- -C "$CONFIG" $ARGS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$service