[omd-commits] OMD Git: omd: Try to speedup apache restart

git version control git at mathias-kettner.de
Thu Jun 9 16:44:23 CEST 2011


Module:   omd
Branch:   master
Commit:   0433a5d12fdffb8ad0f67829e49eeee99a465c10
URL:      http://omdistro.org/projects/omd/repository/revisions/0433a5d12fdffb8ad0f67829e49eeee99a465c10

Author:   Mathias Kettner <mk at mathias-kettner.de>
Date:     Wed Jun  8 20:03:15 2011 +0200
Commiter: Mathias Kettner <mk at mathias-kettner.de>
Date:     Wed Jun  8 20:03:15 2011 +0200

Try to speedup apache restart

---

 packages/apache-omd/skel/etc/init.d/apache |   29 +++++++++++++--------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/packages/apache-omd/skel/etc/init.d/apache b/packages/apache-omd/skel/etc/init.d/apache
index 9d765cd..3f530bb 100644
--- a/packages/apache-omd/skel/etc/init.d/apache
+++ b/packages/apache-omd/skel/etc/init.d/apache
@@ -53,7 +53,7 @@ apache_wait_stop() {
       else
         echo -n "."
         i=$(($i+1))
-        sleep 1
+        sleep 0.1
       fi
      done
   fi
@@ -80,26 +80,25 @@ apache_wait_start() {
     else
       echo -n "."
       i=$(($i+1))
-      sleep 1
+      sleep 0.1
     fi
   done
 
   return 0
 }
 
-kill_stale_php_cgis() {
-  # kill stale php-cgis
-  ps -fu ###SITE### | grep ###PHP_FCGI_BIN### | awk '{ print $2 }' | xargs -r kill >/dev/null 2>&1
-  i=0
-  while [ $(ps -fu ###SITE### | grep -c ###PHP_FCGI_BIN### 2>/dev/null) -gt 0 ]; do
-    if [ $i = '5' ]; then
-      return 1
-    else
-      i=$(($i+1))
-      sleep 1
-    fi
-  done
-  return 0
+kill_stale_php_cgis() 
+{
+    i=1
+    killall -e ###PHP_FCGI_BIN### -u ###SITE### >/dev/null 2>&1 
+    while killall -e ###PHP_FCGI_BIN### -u ###SITE### >/dev/null 2>&1
+    do
+        i=$((i+1))
+        if [ $i -gt 50 ] ; then 
+            return
+        fi
+        sleep 0.1
+    done
 }
 
 case $1 in 



More information about the omd-commits mailing list