Forum: Rails deployment mongrel_cluster restart problem with capistrano

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cf8a610127d1108dfe67f673320b5fe5?d=identicon&s=25 Craig Jolicoeur (craigpj)
on 2007-01-30 16:01
I'm having an issue every time I deploy where my mongrel_cluster isn't
being restarted and I have to do the mongrel_cluster::restart command
myself manually through the terminal on my server.

I've pasted my config/deploy.rb file here for you to see:

http://pastie.caboo.se/36705

Here is my config/mongrel_cluster.yml file:

---
cwd: /var/www/rp-portal/current
port: "8000"
environment: production
pid_file: log/mongrel.pid
servers: 2


I am using a hardware load balancer, that is why I dont have the address
line in the mongrel config file.

any ideas why the deploy task won't restart by cluster?  I don't receive
any errors in the output, in fact the output tells me

Stopping 2 Mongrel servers...
Starting 2 Mongrel servers...

which means to me it worked fine.  but of course it didnt.
4ebfebfcf19c7cb3d4f40607967f179f?d=identicon&s=25 Niall Mullally (Guest)
on 2007-02-11 20:44
(Received via mailing list)
Hi Craig,
I've just started using Capistrano and am having the same problem.
When deploying or rolling back, the mongrel cluster  (3 instances)
fails to restart nearly every time.  The PID files are not being
deleted when the cluster is stopped and so when it tries to start the
cluster again it fails because the PIDs exist.

Other times it has started the cluster but spawned 6-9 mongrel
instances.

Like yourself I've had to resort to restarting the cluster manually
which isn't ideal.

Did you find a solution to this problem?  Or, would anybody else be
able to assist with this?

Thanks in advance for any help.

Regards,

Niall Mullally
http://www.4L.ie/

On Jan 30, 3:01 pm, Craig Jolicoeur <ruby-forum-incom...@andreas-
Cf8a610127d1108dfe67f673320b5fe5?d=identicon&s=25 Craig Jolicoeur (craigpj)
on 2007-02-11 22:06
Niall,

I still have not found a solution to this problem.  Since you have
tracked it down to the fact that the PID files aren't being deleted, I
may be able to work up a solution.  I'll take a look and see if I can
come up with anything

- Craig

Niall Mullally wrote:
> Hi Craig,
> I've just started using Capistrano and am having the same problem.
> When deploying or rolling back, the mongrel cluster  (3 instances)
> fails to restart nearly every time.  The PID files are not being
> deleted when the cluster is stopped and so when it tries to start the
> cluster again it fails because the PIDs exist.
>
> Other times it has started the cluster but spawned 6-9 mongrel
> instances.
>
> Like yourself I've had to resort to restarting the cluster manually
> which isn't ideal.
>
> Did you find a solution to this problem?  Or, would anybody else be
> able to assist with this?
>
> Thanks in advance for any help.
>
> Regards,
>
> Niall Mullally
> http://www.4L.ie/
>
> On Jan 30, 3:01 pm, Craig Jolicoeur <ruby-forum-incom...@andreas-
4ebfebfcf19c7cb3d4f40607967f179f?d=identicon&s=25 Niall Mullally (Guest)
on 2007-02-12 11:56
(Received via mailing list)
Thanks for the reply Craig.

Capistrano was throwing the error about the PID files which is how I
found out about it.  If you weren't seeing an error in the Capistrano
log then you may be having a different problem.

The puzzling thing is, a direct command line call to 'mongrel_rails
cluster::restart' deletes the PID files correctly.  But when
Capistrano calls that function it seems to have problems.

I'm wondering if it's an issue with the location of the PID files -
perhaps they need to be in shared/pids and not log/?  I'm going to
examine the mongrel_cluter/recipes file to see if I can track down the
problem and report back.

Please let me know if you make any progress.

Cheers,

Niall Mullally
http://www.4L.ie/

On Feb 11, 9:06 pm, Craig Jolicoeur <ruby-forum-incom...@andreas-
B6dd90b66749e5f012c6fc121c3fb441?d=identicon&s=25 Ronald Sacher (Guest)
on 2007-02-22 15:55
I had same problem. Seems to be fixed after I changed the setting for
pid_file in in mongrel_cluster.yml to absolute path.

Ronald Sacher
8fd683d54eedb9480f8ce98d01bb4ee1?d=identicon&s=25 Craig Jolicoeur (Guest)
on 2007-02-22 15:59
Ronald Sacher wrote:
> I had same problem. Seems to be fixed after I changed the setting for
> pid_file in in mongrel_cluster.yml to absolute path.
>
> Ronald Sacher

Ronald, you just did the absolute path to your
/app/current/log/mongrel.pid i assume, correct?
A86224d72ce21cd9f5bee6784d4b06c7?d=identicon&s=25 Corey Donohoe (atmos)
on 2007-02-27 03:53
Craig Jolicoeur wrote:
> Ronald Sacher wrote:
>> I had same problem. Seems to be fixed after I changed the setting for
>> pid_file in in mongrel_cluster.yml to absolute path.
>>
>> Ronald Sacher
>
> Ronald, you just did the absolute path to your
> /app/current/log/mongrel.pid i assume, correct?

The problem with restarting is that capistrano has not linked the
tmp/pids directory back before it calls restart.  So basically, unless
you're passing hte path to your 'shared' pids directory it'll always
fail miserably. :(


my mongrel cluster.yml file looks like this
pid_file: /home/production/Sites/milestone/shared/pids/mongrel.pid


Where 'current_path' is normally
/home/production/Sites/milestone/current

Hope this helps.
This topic is locked and can not be replied to.