aboutsummaryrefslogtreecommitdiffstats
path: root/script/restart-mongrel
diff options
context:
space:
mode:
authorkeith <keith>2008-05-30 15:43:39 +0000
committerkeith <keith>2008-05-30 15:43:39 +0000
commit1bd9ad47ee172840de2a4df0357cf8963ce94778 (patch)
tree997ae0801bd4abefd5e8c12a3ff247ad3a6b065a /script/restart-mongrel
parent62dce06826d81d184274d25e45c4aee20c776592 (diff)
Hacked it a bit so it does a kill -9 and removes the pid if need be - not fully tested
Diffstat (limited to 'script/restart-mongrel')
-rwxr-xr-xscript/restart-mongrel16
1 files changed, 14 insertions, 2 deletions
diff --git a/script/restart-mongrel b/script/restart-mongrel
index 004bd0b0e..9de4122a0 100755
--- a/script/restart-mongrel
+++ b/script/restart-mongrel
@@ -9,8 +9,20 @@ if [ -e log/mongrel.pid ]
then
ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails stop
sleep 5s
- ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails start -d
+ if [ -e log/mongrel.pid ]
+ then
+ if ( ps h -p `cat log/mongrel.pid`45 )
+ then
+ echo "kill -9 ing `cat log/mongrel.pid` because it failed to stop"
+ kill -9 `cat log/mongrel.pid`
+ sleep 2s
+ fi
+ if [ -e log/mongrel.pid ]
+ rm log/mongrel.pid
+ fi
+ fi
+ ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails start -d --debug
else
- ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails start -d
+ ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails start -d --debug
fi