From 5bd2aa25f334944f4464fbb0086672286865ae7c Mon Sep 17 00:00:00 2001
From: florian030 <florian@schaal-24.de>
Date: Mon, 17 Feb 2014 07:51:42 -0500
Subject: [PATCH] Merge branch 'master' of http://git.ispconfig.org/ispconfig/ispconfig3

---
 server/mods-available/rescue_core_module.inc.php |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/server/mods-available/rescue_core_module.inc.php b/server/mods-available/rescue_core_module.inc.php
index 94d7ba6..5698273 100644
--- a/server/mods-available/rescue_core_module.inc.php
+++ b/server/mods-available/rescue_core_module.inc.php
@@ -275,6 +275,17 @@
 
 		/* Set the new try counter */
 		$this->_rescueData['webserver']['try_counter'] = $tryCount;
+		
+		if ($tryCount > 2 && $conf['serverconfig']['web']['server_type'] != 'nginx') {
+			if($app->system->is_user('apache')) {
+				$app->log("Clearing semaphores table for user apache.",LOGLEVEL_WARN);
+				exec("ipcs -s | grep apache | awk '{ print $2 }' | xargs ipcrm sem");
+			}
+			if($app->system->is_user('www-data')) {
+				$app->log("Clearing semaphores table for user apache.",LOGLEVEL_WARN);
+				exec("ipcs -s | grep www-data | awk '{ print $2 }' | xargs ipcrm sem");
+			}
+		}
 
 		/* if 5 times will not work, we have to give up... */
 		if ($tryCount > 5){

--
Gitblit v1.9.1