2

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 every time I do an svn up (or svn update) I have to reset the file permission.

How can I solve that? I actually don't 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?

3 Answers 3

2

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.

3
  • +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. Mar 27, 2011 at 0:33
  • Thanks, but he gives me the following: -bash: setfacl: command not found
    – paskster
    Mar 27, 2011 at 12:02
  • 1
    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, 2011 at 15:31
0

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.

-2

svn propset svn:executable ON filename.php

or use CornerStone file property

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .