From be2ead9fd85010b667a7271d611964868fa2092e Mon Sep 17 00:00:00 2001
From: Berthold Cogel <cogel@uni-koeln.de>
Date: Thu, 28 Jul 2016 17:52:35 +0200
Subject: [PATCH] Fix for initscript bug #11650 in /etc/init.d/icinga2 During
 system update icinga2 is started although it is chkconfig off. Patch fixes
 problem with condrestart.

---
 etc/initsystem/icinga2.init.d.cmake | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/etc/initsystem/icinga2.init.d.cmake b/etc/initsystem/icinga2.init.d.cmake
index 204de13..dd01430 100644
--- a/etc/initsystem/icinga2.init.d.cmake
+++ b/etc/initsystem/icinga2.init.d.cmake
@@ -165,11 +165,17 @@ case "$1" in
   status)
         status
         ;;
-  restart|condrestart)
+  restart)
 	checkconfig restart fail
         stop nofail
         start
         ;;
+  condrestart)
+        status > /dev/null 2>&1 || exit 0
+        checkconfig restart fail
+        stop nofail
+        start
+        ;;
   reload)
 	reload
 	;;
-- 
2.5.5

