Hi John,
I've run into the exact same problem with Capistrano 2.4.3. Without
"set :use_sudo, false" Capistrano creates all files and directories
owned by the root user. This is causes major issues with running "cap
deploy" because a normal user can't svn export to these folders and
all "cap deploy" commands will fail with permissions errors.
Also I've noticed that Capistrano will try to use && and parenthesis
to run both the svn export and a echo command to create the REVISIONS
file like this:
command "svn checkout -q -r20
https://svn.mysite.com/repos/trunk/ /
home/site/releases/20080824041856 && (echo 20 > /home/site/releases/
20080824041856/REVISION)"
This will NOT work even if capistrano is appending sudo in front of
"svn checkout" because everything after && will be executed as the
normal user, causing the command to fail. (Just try running "sudo
whoami && whoami").
Additionally, this could be a security issue with users running their
sites on mod_rails (Passenger). I believe mod_passenger will run spawn
rails processes as whatever user owns "environment.rb" (which in this
case would be root). I bet (hope) there are checks in mod_rails to
prevent this, but in any case the rails processes probably won't be
run as the correct user.
Capistrano seems to work fine with "set :use_sudo, false". To fix
this, I deleted everything (files/directories) created by capistrano
and then "set :use_sudo, false" in deploy.rb and re-ran "cap
deploy:setup" and "cap deploy:cold".
Hope that helps someone. Probably should add this to the documentation
because I bet many users will have the same problem.
-Andrew Fiedler