Well, deploy:setup doesn't use sudo, and doesn't look at the :use_sudo variable. (As an aside, the default_run_options variable is new in cap 2.1, but doesn't have any bearing on whether sudo is used or not.)

I'm still on the fence as to whether deploy:setup ought to use sudo.

The workaround is to log into your server(s), and create /var/www/ myapp by hand, with the correct permissions. Then deploy:setup can do the rest. You can do that with cap invoke, btw:

$ cap invoke SUDO=1 COMMAND="mkdir -m 777 /var/www/myapp" deploy:setup
  ...

The capistrano shell works great too:

  $ cap shell
  cap> sudo mkdir -m 777 /var/www/myapp
  ...
  cap> !deploy:setup
  ...

- Jamis

On Nov 16, 2007, at 2:26 PM, Alex Soto wrote:


Hey there,

I'm setting up cap for the first time.  I'm doing it against a server
I control.  When I run cap deploy:setup I see it attempting the
commands but it's failing due to permissions.  It doesn't seem to use
sudo.

* I have the user setup in sudoers with NOPASSWD
* I've set the following in deploy.rb
default_run_options[:pty] = true     (suggestion from another post,
but likely a cap 1.0 solution)
set :use_sudo, true (even though it should default to true)

This is the output: (snipped a little bit)
   * executing `deploy:setup'
   * executing "umask 02 && mkdir -p /var/www/myapp /var/www/myapp/
releases /var/www/myapp/shared /var/www/myapp/shared/system /var/www/
myapp/shared/log /var/www/myapp/shared/pids"
     servers: ["pref"]
     [pref] executing command
** [out :: pref] mkdir: cannot create directory `/var/www/myapp':
Permission denied
** [out :: pref] mkdir: cannot create directory `/var/www/myapp':
Permission denied
** [out :: pref] mkdir: cannot create directory `/var/www/myapp':
Permission denied
** [out :: pref] mkdir: cannot create directory `/var/www/myapp':
Permission denied
** [out :: pref] mkdir: cannot create directory `/var/www/myapp':
Permission denied
** [out :: pref] mkdir: cannot create directory `/var/www/myapp':
Permission denied
     command finished
command "umask 02 && mkdir -p /var/www/myapp /var/www/myapp/releases /
var/www/myapp/shared /var/www/myapp/shared/system /var/www/myapp/
shared/log /var/www/myapp/shared/pids" failed on pref

Thanks for any help,

Alex

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


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to