# Restarting fastCGI process

**URL:** <https://www.ruby-forum.com/t/restarting-fastcgi-process/50594>\
**Category:** Rails\
**Created:** [December 18, 2005, 7:42pm UTC](https://www.ruby-forum.com/t/restarting-fastcgi-process/50594 "2005-12-18T19:42:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [December 18, 2005, 7:42pm UTC](https://www.ruby-forum.com/t/restarting-fastcgi-process/50594/1 "2005-12-18T19:42:24Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [December 18, 2005, 8:55pm UTC](https://www.ruby-forum.com/t/restarting-fastcgi-process/50594/2 "2005-12-18T20:55:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [December 18, 2005, 9:20pm UTC](https://www.ruby-forum.com/t/restarting-fastcgi-process/50594/3 "2005-12-18T21:20:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [December 18, 2005, 11:20pm UTC](https://www.ruby-forum.com/t/restarting-fastcgi-process/50594/4 "2005-12-18T23:20:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [April 5, 2006, 5:35pm UTC](https://www.ruby-forum.com/t/restarting-fastcgi-process/50594/5 "2006-04-05T17:35:12Z")

</div>

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.
