Hi Rick,

First let's talk about the spawner script. Here is how you see its help:

  script/process/spawner -h

By default, the script starts mongrels by using the mongrel_rails command.
Defaults are: 3 mongrels in production environment starting from port 8000.
The process IDs (pids) for these mongrels are saved in "tmp/pids/" directory
of your app.

The default Capistrano recipe for Rails deployment is that it calls
script/spin on "cap deploy:start". The "spin" script isn't there when you
create a Rails application! You have to create it for yourself. Here is my
spin script:

  #!/bin/sh
  script/process/spawner -p 5000 -i 4

So basically it calls the spawner script, giving it 5000 as port for first
Mongrel and to start 4 mongrels. When you create it, mark it as an
executable and add it to your repository!

  chmod +x script/spin
  svn add script/spin
  svn ci script/spin -m "adding spinner script"

Now let's proceed with the reaper script:

  script/process/reaper -h

The reaper script restarts or kills your mongrels. It knows the process IDs
because it reads from the tmp/pids/ directory. By default it just restarts
the processes, but you can kill your mongrels like this:

  script/process/reaper -a kill

Capistrano "deploy:restart" and "deploy:stop" tasks for Rails deployment
both use the reaper script.

The reaper script *will fail* when there are no pids in tmp/pids/. That
means there are no active Mongrels, so reaper script encounters an error.
You got an error because you called "cap deploy", which internally uses the
"deploy:restart" task. It tried to restart mongrels with the reaper, but the
pids weren't there. That's because mongrels were never started because you
didn't have the script/spin script.

So, you can't "cap deploy" if you don't have mongrels running. But you can
first create the spin script like I described. When it's added to your repo,
do "cap deploy:update". That will deploy your code, including the spin
script. Then, "cap deploy:start". That will execute the spin script on the
server. Look at the output for warnings. If it looks like it started, try to
restart it with "cap deploy:restart". When all of this works, you will be
able to "cap deploy".

- Mislav


On Jan 30, 2008 11:37 PM, Rick Schumeyer <[EMAIL PROTECTED]> wrote:

>
> I'm trying to set up capistrano on windows connecting to a linux
> server.  This process has been way more of a pain than I had imagined,
> but I think I am down to my last problem.  (I hope).
>
> I can successfully do:
> cap deploy:setup
> and
> cap deploy:cold
>
> I get a problem during "cap deploy" trying to stop mongrel.
>
> At some point, script/process/reaper is run.  I'm not sure what should
> be in there.  Originally reaper contains:
>
> #!/usr/bin/env ruby
> require File.dirname(__FILE__) + '/../../config/boot'
> require 'commands/process/reaper'
>
> which does not seem to do anything.  I tried replacing this with:
>
> cd /home/webber00/proj/current
> mongrel_rails stop
>
> but that does not work either.
>
> I really really could use some help on this one!
> >
>

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to