]> granicus.if.org Git - icinga2/commitdiff
Fix System-V return codes according to LSB 7183/head
authorSascha Westermann <sascha.westermann@hl-services.de>
Tue, 14 May 2019 09:22:05 +0000 (11:22 +0200)
committerSascha Westermann <sascha.westermann@hl-services.de>
Tue, 14 May 2019 09:22:05 +0000 (11:22 +0200)
- "status"-calls use different exit codes, refer to http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html
- the "status"-call in "condrestart" returned an error if the daemon was not running: this has been fixed

etc/initsystem/icinga2.init.d.cmake

index ef3f521f23e0bc9710e36f84494ddd0240075528..49a6ee2908c3fb53a4db8fa05bce2737a2bae921 100644 (file)
@@ -138,7 +138,7 @@ status() {
 
        if [ ! -e $ICINGA2_PID_FILE ]; then
                echo "Not running"
-               exit 7
+               exit 3
        fi
 
        pid=`cat $ICINGA2_PID_FILE`
@@ -146,7 +146,7 @@ status() {
                echo "Running"
        else
                echo "Not running"
-               exit 7
+               exit 3
        fi
 }
 
@@ -168,7 +168,8 @@ case "$1" in
        start
   ;;
   condrestart)
-       status > /dev/null 2>&1 || exit 0
+       STATUS=$(status > /dev/null 2>&1)
+       if [ $? != 0 ]; then exit 0; fi
        checkconfig restart fail
        stop nofail
        start