# Capistrano and Dreamhost issue

**URL:** <https://www.ruby-forum.com/t/capistrano-and-dreamhost-issue/60928>\
**Category:** Rails\
**Created:** [May 18, 2006, 5:16pm UTC](https://www.ruby-forum.com/t/capistrano-and-dreamhost-issue/60928 "2006-05-18T17:16:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![etxera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@etxera](https://www.ruby-forum.com/u/etxera)\
**Post date:** [May 18, 2006, 5:16pm UTC](https://www.ruby-forum.com/t/capistrano-and-dreamhost-issue/60928/1 "2006-05-18T17:16:59Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![etxera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@etxera](https://www.ruby-forum.com/u/etxera)\
**Post date:** [May 24, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/capistrano-and-dreamhost-issue/60928/2 "2006-05-24T17:10:17Z")

</div>

On 5/18/06, Didier V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://wiki.rubyonrails.com/rails/pages/LighttpdWithProcessScripts) 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,

---

<div class="post-metadata">

**Author:** ![etxera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@etxera](https://www.ruby-forum.com/u/etxera)\
**Post date:** [June 16, 2006, 12:35pm UTC](https://www.ruby-forum.com/t/capistrano-and-dreamhost-issue/60928/3 "2006-06-16T12:35:59Z")

</div>

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) [http://www.seebq.com](http://www.seebq.com)

i’m a bit disappointed !

Didier

---

<div class="post-metadata">

**Author:** ![etxera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@etxera](https://www.ruby-forum.com/u/etxera)\
**Post date:** [June 17, 2006, 2:43pm UTC](https://www.ruby-forum.com/t/capistrano-and-dreamhost-issue/60928/4 "2006-06-17T14:43:29Z")

</div>

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](http://alevans.com). I’ll  
be happy to send you a copy.

–Al Evans
