I use CentOS 5.5, and SVN 1.4.2

I use a working copy on my server as my webapplication, so that I can easily deploy the new code. But what really bothers me, is the fact, that everytime I do an "svn up" (or "svn update") i hava to reset the file permission.

How can I solve that? I actually dont like to create an svn post-commit-hook. Is there any way to tell CentOS that newly added/changed files within certain files should always have certain permissions?

link|improve this question

50% accept rate
feedback

2 Answers

Have you tried with file acl (facl)? You can set default permissions for the new files in a folder.

#set acl for a file: 
setfacl -m u:Usuario:rwx filex
#set default acl for new files in directory
setfacl -dm u:usuario:rmx directory

Use -R option for recursive setfacl.

link|improve this answer
+1, also a reminder that many filesystems will need to be mounted with ACL support enable, which is done by adding "acl" to the options list in /etc/fstab. – Daniel Lawson Mar 27 '11 at 0:33
Thanks, but he gives me the following: -bash: setfacl: command not found – paskster Mar 27 '11 at 12:02
CentOS/RedHad generally install acl package by default but if it doesnt you can install it from yum using: yum install acl as root – CronosNull Mar 27 '11 at 15:31
feedback

The only way I was able to do this is via a post-commit hook. Here are the ones I use:

http://code.getbunch.com/svn-hooks-for-staging-servers/

Basically, you need to install them in the hooks/ directory in your repo. Add the following to your post-commit (after line 27) to make your changes:

# Make sure ownership and permissions are correct is correct
chown myuser.mygroup -R $DIR_TO_TEST_VHOST
chmod 777 -R $DIR_TO_TEST_VHOST

Hope that helps.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.