New sudo behavior for deploy:setup breaks me
Reported by Matt Conway | June 5th, 2008 @ 06:55 PM
Not sure if this is expected behavior, but using try_sudo for deploy:setup/cleanup breaks my use case. Normally I deploy as root, but start all my processes as "rails". When running deploy:setup, its trying to create the root deploy_to directory, but can't as "rails" doesn't have permissions - this used to work fine in 2.1. Note that this is exacerbated for me as I'm continually creating new ec2 instances and deploy to them so I can't just take the one of hit of creating the directory manually.
Theoretically I could give the container directory of deploy_to the right permissions, but I prefer to have all my files in deploy tree owned by root except for the ones that the process need to write to at runtime (tmp/log/etc). This gives me an extra layer of security as a site exploit won't neccessarily be able to do too much as at least they can't write to the files my runtimes depend on. Not sure if if this is really secure or just a perception of security :)
I've probably just coded myself into a corner, but just thought I'd mention it in case you had any insight.
Right now as a workaround I'm doing something like:
before "deploy:setup", "as_root"
before "deploy:cleanup", "as_root"
after "deploy:setup", "not_root"
after "deploy:setup", "not_root"
task :as_root do
set :use_sudo, false
end
task :not_root do
set :use_sudo, true
end
Comments and changes to this ticket
-
Jamis Buck June 5th, 2008 @ 09:33 PM
- → State changed from new to resolved
Agreed, this has actually bothered me somewhat, too. This is fixed now in http://github.com/jamis/capistra.... Basically, deploy:start, deploy:stop, and deploy:restart are the only tasks that will use :runner. All others will use :admin_runner, which by default is unset, causing any other deployment tasks that try to use sudo, to sudo as root.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
