Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I commit a change to the Ubuntu Subversion, I always get the error below.

~$ sudo svn commit -m "Initial Commit" test.txt --username akira

svn: Commit failed (details follow):
svn: Can't open file '/home/svn/myrepo/db/txn-current-lock': Permission denied

How should I set the permission to the txn-current-lock? I set the permissions below beforehand.

~$ sudo chown -R taro:subversion myrepo
~$ sudo chmod -R g+rws /home/svn/myrepo
share|improve this question
    
How is your repository initialized? I.e. what command like svn co ... (or svn checkout) have you ran? –  Lekensteyn Feb 19 '12 at 12:28
    
svn://, svn+ssh:// or http:// repo? –  Lazy Badger Feb 19 '12 at 12:29
    
The command was 'sudo svn co 192.168.253.130/svn/repository /home/akira/svn/repository --username akira' –  Akira Tsuchiya Feb 19 '12 at 12:56
    
Wait, you're committing as root, and you get a permission denied error? Weird. Is /home mounted over NFS or something? –  Marius Gedminas Feb 19 '12 at 13:51

1 Answer 1

up vote 0 down vote accepted

As you've said:

The command was sudo svn co http://192.168.253.130/svn/repository /home/akira/svn/repository --username akira

That means that you're checking out from the server 192.168.253.130 over HTTP to the local directory /home/akira/svn/repository as user akira. The read/write privileges on the SVN server (a centralized repository) are determined by the program serving SVN over HTTP (likely Apache). Apache is running as www-data and cannot write to /home/svn/myrepo/db/txn-current-lock if it's not owned by you.

I suggest you to start a svnserve daemon as the svn user and use that instead of Apache. The URL http://192.168.253.130/svn/repository then becomes something like svn://192.168.253.130/myrepo when using this initscript that basically invokes svnserve --root=/home/svn --threads as user svn. If you're running a local subversion server, you can add the --listen-host=localhost option for added security.

share|improve this answer
    
When using svn:// protocol, some case is successful and another case fails. –  Akira Tsuchiya Feb 20 '12 at 14:30
    
When using svn:// protocol, some case is successful and another case fails. On the server, [svnserve -d --root=/home/svn --threads] is started as the user of svn. And on the client, [svn co svn://***] and [svn add ***] succeed but [svn commit] fails with the error of [Authorization failed]. I am confused. Could you give me another hint? –  Akira Tsuchiya Feb 20 '12 at 14:37
    
Have a look in the files in /home/svn/myrepo/db/conf/, especially the passwd file and anon-access/auth-access settings –  Lekensteyn Feb 20 '12 at 15:40
    
Thank you. It worked. –  Akira Tsuchiya Feb 21 '12 at 4:56

Your Answer

 
discard

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.