[icinga-checkins] icinga.org: icinga-core/mfriedrich/oracle: Check if icinga is already running in init script before starting it Closes : #77

git at icinga.org git at icinga.org
Tue Oct 6 18:30:10 CEST 2009


Module: icinga-core
Branch: mfriedrich/oracle
Commit: 3acbacf04537037d731ccd405c1fa116fc80fd3e
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=3acbacf04537037d731ccd405c1fa116fc80fd3e

Author: Christoph Maser <cmr at financial.com>
Date:   Sun Oct  4 11:41:43 2009 +0200

Check if icinga is already running in init script before starting it Closes: #77

---

 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





More information about the icinga-checkins mailing list