[icinga-devel] [PATCH] Check if icinga is already running in init script before starting it Closes: #77

Christoph Maser cmr at financial.com
Sun Oct 4 12:18:29 CEST 2009


---
 daemon-init.in |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/daemon-init.in b/daemon-init.in
index 6a5bcfc..272728c 100644
--- a/daemon-init.in
+++ b/daemon-init.in
@@ -121,6 +121,14 @@ fi
 case "$1" in

        start)
+               # Check if icinga is already running
+               $0 status > /dev/null
+                if [ $? -eq 0 ]; then
+                        pid_icinga
+                        echo "Icinga is already running. PID: $IcingaPID"
+                        exit 1
+                fi
+
                echo -n "Starting icinga:"
                $IcingaBin -v $IcingaCfgFile > /dev/null 2>&1;
                if [ $? -eq 0 ]; then
--
1.6.2.5


financial.com AG

Munich head office/Hauptsitz München: Maria-Probst-Str. 19 | 80939 München | Germany
Frankfurt branch office/Niederlassung Frankfurt: Messeturm | Friedrich-Ebert-Anlage 49 | 60327 Frankfurt | Germany
Management board/Vorstand: Dr. Steffen Boehnert | Dr. Alexis Eisenhofer | Dr. Yann Samson | Matthias Wiederwach
Supervisory board/Aufsichtsrat: Dr. Dr. Ernst zur Linden (chairman/Vorsitzender)
Register court/Handelsregister: Munich – HRB 128 972 | Sales tax ID number/St.Nr.: DE205 370 553




More information about the icinga-devel mailing list