Forum: Ruby on Rails restarting fastCGI process

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jordan I. (Guest)
on 2005-12-18 20:42
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!!
Eero S. (Guest)
on 2005-12-18 21:55
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
Lee Pope (Guest)
on 2005-12-18 22:20
(Received via mailing list)
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.
ben wiseley (Guest)
on 2005-12-19 00:20
(Received via mailing list)
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
Richard C. (Guest)
on 2006-04-05 19:35
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.
This topic is locked and can not be replied to.