how to configure user and group in script/spin ?

2 views
Skip to first unread message

LeeRoy

unread,
Aug 29, 2008, 11:59:33 PM8/29/08
to Capistrano
Everything is in the title
... but I'll explain.

I use my rails application in production 1 month ago, but I install
capistrano now.
My problem is when I try to start with "cap deploy:start". I have not
error message but, on the server, mongrel process have a short life.
And when I compare the actual ps with old one I see user and group
options are not define.

I trought to change script/spin like it, but it doesn't change
anything

/path/current/script/process/spawner \
mongrel \
--user=apache-user \
--group=apache-group \
--environment=production \
--instances=3 \
--address=127.0.0.1 \
--port=8000

It the reason why i ask "how to configure user and group in script/
spin".

Thank you for reading

Rafael G.

unread,
Sep 1, 2008, 4:10:52 AM9/1/08
to capis...@googlegroups.com
Rewrite start, stop and restart tasks for works with mongrel and use
mongrel_cluster.yml.
This will solve the problem (without spawner script), example:

namespace :deploy do
desc "Modified start task for work ONLY with mongrel cluster"
task :start, :roles => :app do
run "mongrel_rails cluster::start -C
#{deploy_to}/current/config/mongrel_cluster.yml"
end
... # same stuff for stop and restart
end

If you had latest mongrel you can use --clean parameter too (clean pid
files).

LeeRoy escribió:
--
Rafael Garcia Ortega

rgo.vcf

LeeRoy

unread,
Sep 2, 2008, 9:39:42 PM9/2/08
to Capistrano
I understand your idea,
but it move the problem and not resolve it... not yet

I can't do this because I need to be root to run mongrel_rails, and I
need to be root to run mongrel with a special user
when I run:
task :start, :roles => :app do
run "sudo mongrel_rails cluster::start -C /etc/mongrel_cluster/
viniway.yml"
end

I have:
*** [err :: mysite.com] [sudo] password for lunix_user:

Do you know if I could give to "run" my password?
>  rgo.vcf
> < 1KViewDownload

Rafael G.

unread,
Sep 2, 2008, 10:37:10 PM9/2/08
to capis...@googlegroups.com
I don't have all scheme in my head.
Why you need to be root to run mongrel? Why not load mongrel with the
same user?

LeeRoy escribió:
--
Rafael Garcia Ortega

rgo.vcf

LeeRoy

unread,
Sep 3, 2008, 8:33:02 AM9/3/08
to Capistrano
For security resons, it's good to use a specific user for each server,
isn't it?
>  rgo.vcf
> < 1KViewDownload

Rafael G.

unread,
Sep 3, 2008, 10:36:55 AM9/3/08
to capis...@googlegroups.com
Yes, I do it. But I connect with ssh using this user.

LeeRoy escribió:
--
Rafael Garcia Ortega

rgo.vcf

Jamis Buck

unread,
Sep 3, 2008, 11:59:03 AM9/3/08
to capis...@googlegroups.com
Use the sudo() helper instead of run():

sudo "mongrel_rails ..."

That'll prompt for the password correctly.

- Jamis

> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>

Reply all
Reply to author
Forward
0 new messages