X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=contrib%2Fredhat%2Finit.d-collectd;h=829eda5fcdc4d3c553f3c38d8c7a075aa4149c9d;hb=de407dd4e036f73e9bd4658af9d71f504fc11109;hp=4c69f3c9b7e0dd88fc1ac793eca7a7e68b02bb62;hpb=8aad55ab7d737a97d5927458b2b00885e27cae4d;p=collectd.git diff --git a/contrib/redhat/init.d-collectd b/contrib/redhat/init.d-collectd index 4c69f3c9..829eda5f 100644 --- a/contrib/redhat/init.d-collectd +++ b/contrib/redhat/init.d-collectd @@ -42,7 +42,6 @@ check_config() { return 0 } - start () { echo -n $"Starting collectd: " check_config @@ -58,6 +57,7 @@ start () { [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$service fi } + stop () { echo -n $"Stopping collectd: " killproc -p $COLLECTDMONPID -d $MAXWAIT $prog @@ -65,6 +65,20 @@ stop () { echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$service } + +restart () { + check_config + rc="$?" + if test "$rc" -ne 0; then + RETVAL=6 + echo $"not restarting due to configuration error" + failure $"not restarting $service due to configuration error" + else + stop + start + fi +} + # See how we were called. case "$1" in start) @@ -77,16 +91,7 @@ case "$1" in status -p $COLLECTDMONPID $prog ;; restart|reload) - check_config - rc="$?" - if test "$rc" -ne 0; then - RETVAL=6 - echo $"not restarting due to configuration error" - failure $"not restarting $service due to configuration error" - else - stop - start - fi + restart ;; condrestart) [ -f /var/lock/subsys/$service ] && restart || :