Restarting fastCGI process

Hi, I am very new to this so please go easy on me… I am trying to
deploy my app on dreamhost and I seem to be having problems getting it
working. One of the troubleshooting items on the wiki states:

Rails apps in production mode do not reflect changes made after they
start running. So, if you found a bug, fixed it and nothing appeared to
happen–this is probably because you haven’t restarted your fcgi
processes. Run killall -9 ruby a couple of times. It might also take a
couple of browser refreshes for the change to take affect.

How do I “Run killall -9 ruby”??

Thanks in advance!!

Jordan I. wrote:

Hi, I am very new to this so please go easy on me… I am trying to
deploy my app on dreamhost and I seem to be having problems getting it
working. One of the troubleshooting items on the wiki states:

Rails apps in production mode do not reflect changes made after they
start running. So, if you found a bug, fixed it and nothing appeared to
happen–this is probably because you haven’t restarted your fcgi
processes. Run killall -9 ruby a couple of times. It might also take a
couple of browser refreshes for the change to take affect.

How do I “Run killall -9 ruby”??

If you are on an UNIXy system, you can just enter

killall -9 ruby

From the command-line. This will forcibly terminate
any running ruby processes, so it may or may not be
desirable. An alternative would be to type

ps aux

Which shows the running process list and then look
for something saying fcgi or dispatch.fcgi on the
right-hand side. The column on the very far left
column is the process ID, pid. Look it up and type

kill -9 [pid]

This will kill that process alone. Just repeat
the sequence for the other processes’ pids.

Thanks in advance!!

E

An even better option might be to run the ‘reaper’ script under
script/process. This script will find all dispatch.fcgi instances,
terminate
them, then restart them.

Is this kosher to do on shared boxes (like on Site5 or TextDrive
hosting)?
I’m pretty new to linux/unix and wasn’t sure if the stuff below would
wipe
everyone out - or just my account.

-ben

ben wiseley wrote:

Is this kosher to do on shared boxes (like on Site5 or TextDrive
hosting)?
I’m pretty new to linux/unix and wasn’t sure if the stuff below would
wipe
everyone out - or just my account.

-ben

Yup it does, i found out the hard way when my admin suspened my ssh
access.

If anyones intereseted, I made a small hack to dispatch.fcgi

Add this at the begining
File.open(“dispatch_fcgi.pid”,“w”) {|f| f.write Process.pid }

then use
kill -9 cat dispatch_fcgi.pid

in your public dir to kill the proccess, if your gonna do this lots may
want to find a better way. It takes a couple trys for the server to
startup again.