Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|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

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

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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