Capistrano and Dreamhost issue

Hi,

i’m striving to capistranize a foo app on DH.

Everything is hosted on DH to simplify a bit :

  • svn repository (http access)
  • the application
  • the DB

I used the recipe of Jamis B. modified by Geoffrey Grosenbach which
you can find here : http://nubyonrails.com/pages/shovel_dreamhost

I did the least modifications possible. As recommended.

  1. When I launch the ‘rake deploy’ it appears that the reaper and
    spawner script are not correctly “chmoded”, neither is executable. So I
    get an error message “permission denied”.

  2. Anyway I connect thru ssh and do the work manually :

chmod +x reaper
chmod +x spawner
./reaper --dispatcher=dispatch.fcgi

and the response is :

Couldn’t find any process matching: dispatch.fcgi

By the way, the dispatch.* files are not executable but chmoding them
doesn’t change the response (it is perhaps obvious)

Any idea ?

Didier

On 5/18/06, Didier V. [email protected] wrote:

  1. When I launch the ‘rake deploy’ it appears that the reaper and
    spawner script are not correctly “chmoded”, neither is executable. So I
    get an error message “permission denied”.

One of the few things I do in the after update code tasks are:

desc “Tasks to execute after code update”
task :after_update_code, :roles => [:app, :db] do

…snip…

sudo “chmod -R +x #{release_path}/script/"
sudo "chown -R #{user} #{release_path}/script/

…snip…

end

I think you can also get away with just:

run “chmod 755 #{release_path}/script/process/spawner”
run “chmod 755 #{release_path}/script/process/reaper”

doing the numeric executable for owning user if you’re paranoid.

  1. Anyway I connect thru ssh and do the work manually :

chmod +x reaper
chmod +x spawner
./reaper --dispatcher=dispatch.fcgi

and the response is :

Couldn’t find any process matching: dispatch.fcgi

This is because you might be launching:

/path/to/app/releases/release_num/public/dispatch.fcgi

but are now trying to reap:

/path/to/app/current/dispatch.fcgi

see which ones are running by using:

ps aux | grep dispatch.fcgi

and compare that to the ones your reaper is trying to reap.

I also have an updated spin task that is not hardcoded to the server,
though
it requires a little unix scripting, see:

Peak Obsession until
I
finish my writeups.

I’d like to add this to the real Deploying with Capistrano page, as I’ve
setup quite a few boxen for our customers and clients using capistrano
with
single servers and multi-boxen (web/app and db separate), but I’m
working on
that.

hope that helps,

Hi,

i’m still experiencing problems …

though i tested

desc “Tasks to execute after code update”
task :after_update_code, :roles => [:app, :db] do

…snip…

sudo “chmod -R +x #{release_path}/script/"
sudo "chown -R #{user} #{release_path}/script/

…snip…

end

where i changed sudo in run as i’m not a sudoer user
and added the line
run “chmod -R 755 #{release_path}/public”

the task executes without problem.

But i still get the error when the reaper tries to execute

Couldn’t find any process matching: /path/to/app/current/public/dispatch.fcgi

however dispatch.fcgi exists, is 755 as anything else in public/ and the
symlink ‘current’ references the correct release

This is because you might be launching:

/path/to/app/releases/release_num/public/dispatch.fcgi

but are now trying to reap:

/path/to/app/current/dispatch.fcgi

[…]


Charles Brian Q.
www.seebq.com http://www.seebq.com

i’m a bit disappointed !

Didier

Didier V. wrote:

But i still get the error when the reaper tries to execute

Couldn’t find any process matching: /path/to/app/current/public/dispatch.fcgi

however dispatch.fcgi exists, is 755 as anything else in public/ and the
symlink ‘current’ references the correct release

I’ve seen this problem on Dreamhost. What’s happening is that because of
a bit of software involved in the hosting setup (I can’t remember the
name at the moment), absolute paths don’t look the same from a script as
they do from a shell. For example:

server:~ me$ pwd
/home/me
server:~ me$ ruby -e ‘puts pwd
/home/.chandra/me
server:~ me$ perl -e ‘print pwd
/home/.chandra/me

There are a few other problems with the stock reaper script – for
example, if you’ve got two or more applications running, it doesn’t
distinguish between them.

I’ve written a “smart” replacement script. I’ve got a bit more testing
to do before I release it to the world, but I’ve been pleased with it so
far. It parses the FCGI crash log to find out which dispatcher processes
are running for a specific app, and adds an “expire” command for
dispatchers that have become unresponsive (which I see a lot on
Dreamhost).

if you’d like to help test, send me an email: anejr at alevans.com. I’ll
be happy to send you a copy.

–Al Evans