]> arthur.barton.de Git - netdata.git/commitdiff
redhat_init_script_fix_exitcode branch
authorearthgecko <gary.wilson@of-networks.co.uk>
Fri, 15 Apr 2016 12:04:15 +0000 (13:04 +0100)
committerearthgecko <gary.wilson@of-networks.co.uk>
Fri, 15 Apr 2016 12:04:15 +0000 (13:04 +0100)
Fixed init script for Redhat6/Centos6 to return the correct exit code from
daemon
modified:
system/netdata-init-d.in

system/netdata-init-d.in

index 8c46433693d9a091f6ef1d2e4d0a149bd5654b57..c317d10211679e46243771e357b1803076b432da 100755 (executable)
@@ -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()