Hello,
when I deploy my application via capistrano (using the default recipe):
$ cap deploy
everything appears to go well until the system complains that
script/process/reaper cannot be found.
It turns out that the whole of ‘current’ and all subdirectories and
files newly created on the production server have attributes set to 664,
which prevents files from being executed.
I can manually fix that:
$ sudo chmod -R 775 /home/rails/myapp
$ /home/rails/myapp/current/script/process/reaper
and the application starts flawlessly.
I am not sure why this is happening. My development directories are all
775, and the same goes for the whole deployment tree on the production
server. It’s just that the files fetched from svn by the capistrano are
given these permissions.
My limited Linux skills are not helping right now…
I have a couple of tasks that resets permissions for me:
task :restart, :roles => :app do
run " chmod +x #{deploy_to}/current/lib/daemons/someprocess"
run " chmod +x #{deploy_to}/current/lib/daemons/someprocess.rb"
run " mongrel_rails cluster::restart -C
/var/www/#{application}/current/config/mongrel_cluster.yml"
run " #{deploy_to}/current/lib/daemons/someprocessrestart"
end
task :after_update_code do
run “chown -R apache:apache #{deploy_to}/current/public/somefolder”
end
Not sure if thats the “capify-way”… but seems to work fine.
It may be that the files in the repository are not executable, even
though you have changed the permissions on your working copy. You can
tell subversion that files are executable using svn propset like this;
It may be that the files in the repository are not executable, even
though you have changed the permissions on your working copy. You can
tell subversion that files are executable using svn propset like this;
cd yourapp/script/process
svn propset svn:executable ON reaper
Thank you David, it made sense and it did work.
Cheers,
Giuseppe
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.