On 07/08/07, Jamis Buck <[EMAIL PROTECTED]> wrote:
>
> process/reaper should work fine with mongrel_rails. Just make sure
> mongrel_rails writes it's pid file to tmp/pids (which ought to be a
> symlink pointing to the shared directory somewhere). You might still
> need to override deploy:stop and deploy:restart, to pass the necessary
> parameters to the reaper (so it knows what the names of the pid files
> are).
Thanks for the lightning fast response; I may well end up taking your
suggested route shortly. Whilst waiting to hear what you thought might
be the best solution, I thought I could probably get it to work with
vanilla Capistrano tasks by re-writing the reaper script.
My reaper script now looks like this:
#!/bin/sh
ACTION="${2:-restart}"
set -e
cd /var/wordtracker/apps/kimble/current
if [ "$ACTION" = "kill" ]; then
mongrel_rails cluster::stop
else
su -c 'mongrel_rails cluster::restart' deploy
fi
I'm just testing it now, but it seems to work fine.
Note that I've had to manually su to the 'deploy' user when restarting
the cluster, as the deploy:restart task runs the reaper task as root
rather than as the :runner user (both deploy:start and deploy:stop run
as the :runner user).
Would it be a bad idea to get :restart to use the :runner user?
Cheers,
Graham
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---