Welcome Guest | Login

reaper runs amok, but doesn't kill any process, even mine

So I've got my capistrano scripts working except for one thing - the reaper can't kill my fastcgi process.

The wierd thing is that the reaper seems to go through many processes, generating a whole stream of errors of the form
Restarting <pid>
kill
<pid>: Operation not permitted

When it gets to the actual pid of my fastcgi process, I see
Restarting <pid>
kill
and then no error message, but the fastcgi doesn't go away.

Everything is chmodded correctly, and all the shared dirs exist, though shared/pids is empty when I have a fastcgi process alive (should this be the case?).

Any ideas?
I should think the reaper would only try to kill my processes, not those of others.

Thanks in advance

2008-04-21 11:00 PM

You can just ignore "Operation not permitted" errors as the command "killall dispatch.fcgi" tries to kill all the fcgi process on the server which is not permitted for the users. But it will kill the fcgi process owned by you.

2008-04-22 01:06 AM

Actually, it doesn't kill the fastcgi owned by me. I do a ps before and after the cap deploy:restart, and the fastcgi process is still there.

2008-04-22 01:43 AM

I think the :restart task isn't working properly because
it uses the currrent_path variable which contains the symbolic link to current. Therefore reaper tries to find a process named like   /home/username/yourapp/current/public/dispatch.fcgi
while the actual running process would be  /home/username/yourapp_releases/20061116132946/public/dispatch.fcgi

You might be able to work around this if you change the restart task from

task :restart, :roles => :app do
   run "#{current_path}/script/process/reaper --dispatcher=dispatch.fcgi"
   run "cd #{current_path} && chmod 755 #{chmod755}"
 end

to

task :restart, :roles => :app do
   run "readlink #{current_path}/script/process/reaper --dispatcher=dispatch.fcgi"
   run "cd #{current_path} && chmod 755 #{chmod755}"



2008-04-22 07:26 AM

I'm not sure I understand the readlink solution. ps shows /usr/local/bin/ruby dispatch.fcgi,
not something prefixed with /home.... as you indicated.

Anyway, I tried the line you suggested, but readlink thinks --dispatcher is an illegal switch.

I am wondering... what is supposed to be in the /shared/pids directory? Mine is always empty.

Thanks for all help...

2008-04-23 12:23 AM

Hi Pwhallinan,

The issue with the ps command has been fixed.
If you are using mongrel_cluster then only /shared/pids directory contains the "pid value".
For single instance mongrel the pid value will be inside rails_app/log/mongrel.pid.If you stop mongrel this pid value will automatically removed.  
 

2008-04-23 07:12 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.