summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8a533ce)
raw | patch | inline | side by side (parent: 8a533ce)
author | Florian Forster <octo@collectd.org> | |
Thu, 30 May 2013 06:26:09 +0000 (08:26 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 30 May 2013 06:26:09 +0000 (08:26 +0200) |
Github: #298
contrib/redhat/init.d-collectd | patch | blob | history |
index 52bf7433c8a4732b0251ad4a3ee65f3821aa807f..abdb168f15d28cce78db59ca29589d2ef0a40e5d 100644 (file)
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() {
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