# 664 permissions after cap deploy

**URL:** <https://www.ruby-forum.com/t/664-permissions-after-cap-deploy/122421>\
**Category:** Deployment\
**Created:** [December 7, 2007, 2:50pm UTC](https://www.ruby-forum.com/t/664-permissions-after-cap-deploy/122421 "2007-12-07T14:50:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![giuseb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@giuseb](https://www.ruby-forum.com/u/giuseb)\
**Post date:** [December 7, 2007, 2:50pm UTC](https://www.ruby-forum.com/t/664-permissions-after-cap-deploy/122421/1 "2007-12-07T14:50:07Z")

</div>

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…

Thank you all in advance!

Giuseppe

---

<div class="post-metadata">

**Author:** ![giuseb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@giuseb](https://www.ruby-forum.com/u/giuseb)\
**Post date:** [December 7, 2007, 5:02pm UTC](https://www.ruby-forum.com/t/664-permissions-after-cap-deploy/122421/2 "2007-12-07T17:02:02Z")

</div>

Hi Giuseppe -

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.

Dave  
[http://www.silverrack.com](http://www.silverrack.com)

On Dec 7, 2007 6:50 AM, Giuseppe B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![giuseb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@giuseb](https://www.ruby-forum.com/u/giuseb)\
**Post date:** [December 7, 2007, 5:49pm UTC](https://www.ruby-forum.com/t/664-permissions-after-cap-deploy/122421/3 "2007-12-07T17:49:44Z")

</div>

Thanks Dave, I’ll give’em a try!  
So I take it I’m not the only one experiencing this type of problem.  
Hmmm…

Giuseppe

Dave Stevenson wrote:

> I have a couple of tasks that resets permissions for me:

---

<div class="post-metadata">

**Author:** ![giuseb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@giuseb](https://www.ruby-forum.com/u/giuseb)\
**Post date:** [December 8, 2007, 1:38pm UTC](https://www.ruby-forum.com/t/664-permissions-after-cap-deploy/122421/4 "2007-12-08T13:38:07Z")

</div>

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

More info here;

[svn propset](http://svnbook.red-bean.com/en/1.0/re23.html)

Hope this helps

David

---

<div class="post-metadata">

**Author:** ![giuseb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@giuseb](https://www.ruby-forum.com/u/giuseb)\
**Post date:** [December 10, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/664-permissions-after-cap-deploy/122421/5 "2007-12-10T14:07:28Z")

</div>

David S. wrote:

> 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
