aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/foimongreld.ugly46
-rw-r--r--config/httpd.conf5
2 files changed, 36 insertions, 15 deletions
diff --git a/config/foimongreld.ugly b/config/foimongreld.ugly
index 5be87f9bf..fa56eac53 100644
--- a/config/foimongreld.ugly
+++ b/config/foimongreld.ugly
@@ -10,11 +10,25 @@ DUSER=!!(*= $user *)!!
function stop_mongrels {
PORT=3000 stop_mongrel
PORT=3001 stop_mongrel
+ PORT=3002 stop_mongrel
+ PORT=3003 stop_mongrel
+ PORT=3004 stop_mongrel
+
+ sleep 5s
+
+ PORT=3000 check_stopped
+ PORT=3001 check_stopped
+ PORT=3002 check_stopped
+ PORT=3003 check_stopped
+ PORT=3004 check_stopped
}
function start_mongrels {
PORT=3000 start_mongrel
PORT=3001 start_mongrel
+ PORT=3002 start_mongrel
+ PORT=3003 start_mongrel
+ PORT=3004 start_mongrel
}
function stop_mongrel {
@@ -23,26 +37,30 @@ function stop_mongrel {
if [ -e $PIDFILE ]
then
su $DUSER -c "cd $RUNDIR; /usr/bin/ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails stop -p $PORT -P $PIDFILE"
- sleep 5s
- if [ -e $PIDFILE ]
- then
- if ( ps h -p `cat $PIDFILE` )
- then
- echo "kill -9 ing `cat $PIDFILE` because it failed to stop"
- kill -9 `cat $PIDFILE`
- sleep 2s
- fi
- fi
- if [ -e $PIDFILE ]
- then
- rm $PIDFILE
- fi
else
echo " pidfile does not exist, start first "
return 1
fi
}
+function check_stopped {
+ PIDFILE=$PIDDIR/mongrel.$PORT.pid
+
+ if [ -e $PIDFILE ]
+ then
+ if ( ps h -p `cat $PIDFILE` )
+ then
+ echo "kill -9 ing `cat $PIDFILE` because it failed to stop"
+ kill -9 `cat $PIDFILE`
+ sleep 2s
+ fi
+ fi
+ if [ -e $PIDFILE ]
+ then
+ rm $PIDFILE
+ fi
+}
+
function start_mongrel {
PIDFILE=$PIDDIR/mongrel.$PORT.pid
diff --git a/config/httpd.conf b/config/httpd.conf
index 6994cd5af..0e0d15c17 100644
--- a/config/httpd.conf
+++ b/config/httpd.conf
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org
#
-# $Id: httpd.conf,v 1.20 2008-11-17 12:57:16 francis Exp $
+# $Id: httpd.conf,v 1.21 2008-11-17 13:33:42 francis Exp $
# This is needed for the PHP spell checker
<Location /fcgi>
@@ -51,6 +51,9 @@ RewriteRule /down.html / [R]
<Proxy balancer://foicluster>
BalancerMember http://localhost:3000
BalancerMember http://localhost:3001
+BalancerMember http://localhost:3002
+BalancerMember http://localhost:3003
+BalancerMember http://localhost:3004
# really should be lbmethod=bybusyness, but we don't have that algorithm yet.
# If it becomes a problem, upgrade or patch Apache with it. See:
# see http://labs.reevoo.com/2008/8/19/bybusy-mod-accepted-by-apache