X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=debian%2Fcollectd-core.collectd.init.d;h=f1bb42943a103508503968dff73ab35d16b49987;hb=ef85d58d62a1174f6861f6e0649a5a2578ec2921;hp=dc582e4fa433d931f4848eb27e6550f2ecc24d89;hpb=5fd4903ea0ddbec78be5a241c4de2ddb4a2e14f2;p=pkg-collectd.git diff --git a/debian/collectd-core.collectd.init.d b/debian/collectd-core.collectd.init.d index dc582e4..f1bb429 100755 --- a/debian/collectd-core.collectd.init.d +++ b/debian/collectd-core.collectd.init.d @@ -1,7 +1,7 @@ #! /bin/bash # # collectd - start and stop the statistics collection daemon -# http://collectd.org/ +# https://collectd.org/ # # Copyright (C) 2005-2006 Florian Forster # Copyright (C) 2006-2009 Sebastian Harl @@ -37,7 +37,6 @@ PIDFILE=/var/run/collectd.pid USE_COLLECTDMON=1 COLLECTDMON_DAEMON=/usr/sbin/collectdmon -COLLECTDMON_PIDFILE=/var/run/collectdmon.pid MAXWAIT=30 @@ -52,12 +51,6 @@ if test "$ENABLE_COREFILES" == 1; then ulimit -c unlimited fi -if test "$USE_COLLECTDMON" == 1; then - _PIDFILE="$COLLECTDMON_PIDFILE" -else - _PIDFILE="$PIDFILE" -fi - # return: # 0 if config is fine # 1 if there is a syntax error @@ -98,12 +91,12 @@ d_start() { fi if test "$USE_COLLECTDMON" == 1; then - start-stop-daemon --start --quiet --oknodo --pidfile "$_PIDFILE" \ - --exec $COLLECTDMON_DAEMON -- -P "$_PIDFILE" -- -C "$CONFIGFILE" \ + start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" \ + --exec $COLLECTDMON_DAEMON -- -P "$PIDFILE" -- -C "$CONFIGFILE" \ || return 2 else - start-stop-daemon --start --quiet --oknodo --pidfile "$_PIDFILE" \ - --exec $DAEMON -- -C "$CONFIGFILE" -P "$_PIDFILE" \ + start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" \ + --exec $DAEMON -- -C "$CONFIGFILE" -P "$PIDFILE" \ || return 2 fi return 0 @@ -119,9 +112,9 @@ the disk. You can adjust the waiting time in /etc/default/collectd." # 1 if the daemon was already stopped # 2 if daemon could not be stopped d_stop() { - PID=$( cat "$_PIDFILE" 2> /dev/null ) || true + PID=$( cat "$PIDFILE" 2> /dev/null ) || true - start-stop-daemon --stop --quiet --oknodo --pidfile "$_PIDFILE" + start-stop-daemon --stop --quiet --oknodo --pidfile "$PIDFILE" rc="$?" if test "$rc" -eq 2; then @@ -167,7 +160,7 @@ case "$1" in esac ;; status) - status_of_proc -p "$_PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $? + status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $? ;; restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME"