From: earthgecko Date: Fri, 15 Apr 2016 12:04:15 +0000 (+0100) Subject: redhat_init_script_fix_exitcode branch X-Git-Tag: v1.1.0~17^2 X-Git-Url: https://arthur.barton.de/gitweb/?p=netdata.git;a=commitdiff_plain;h=7a361ec034831060b12debf8b8ea97f2ed5b66c5 redhat_init_script_fix_exitcode branch Fixed init script for Redhat6/Centos6 to return the correct exit code from daemon modified: system/netdata-init-d.in --- diff --git a/system/netdata-init-d.in b/system/netdata-init-d.in index 8c464336..c317d102 100755 --- a/system/netdata-init-d.in +++ b/system/netdata-init-d.in @@ -13,17 +13,23 @@ STOP_TIMEOUT="10" service_start() { - printf "%-50s" "Starting $DAEMON..." + echo "Starting $DAEMON..." daemon $DAEMON_PATH/$DAEMON $DAEMONOPTS + RETVAL=$? echo + return $RETVAL } service_stop() { printf "%-50s" "Stopping $DAEMON..." killproc -p ${PIDFILE} -d ${STOP_TIMEOUT} $DAEMON - rm -f ${PIDFILE} + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + rm -f ${PIDFILE} + fi echo + return $RETVAL } service_status()