SVN server only allows commits when run as root
So as of two days ago, i had myself a shiny new SVN server. I set it up for WebDAV with no problems. It wasn't until i tried to host multiple开发者_运维知识库 projects that i ran into trouble.
At first, i had all of the project folders in one repository. But then i saw the error in my ways, and switched to multiple repositories. Rather than edit the /etc/apache2/sites-available/default
file with every new project, i elected to use the svnserve deamon.
So, the problem is, i cn only make commits from Eclipse when the daemon is run as root. If not, I get a Permission Denied Error. Any ideas? Here are the directory stats:
drwxr-xr-x 6 root root 4096 2011-06-07 09:38 .
drwxr-xr-x 4 root root 4096 2011-06-05 00:48 ..
lrwxrwxrwx 1 svn svn 6 2011-06-06 22:35 all -> repos/
drw-rw-r-- 6 svn svn 4096 2011-06-06 13:53 EmpowerView
drw-rw-r-- 6 svn svn 4096 2011-06-06 13:54 GoogleVoicemail
-rw-rw-r-- 2 svn svn 307 2011-06-07 08:47 passwd
drw-rw-r-- 6 svn svn 4096 2011-06-06 13:54 PerlinNoise
drw-rw-r-- 7 svn svn 4096 2011-06-05 02:15 repos
-rw-rw-r-- 3 svn svn 2278 2011-06-07 08:46 svnserve.conf
EDIT
I tried the suggested re-checkout with the daemon not running as root, and still no cigar. Same permission error.
EDIT 2
I also tried running the daemon as the user svn, but no such luck. At one point I screwed up my primary group and no longer had sudo privileges! I had to hack into my own server through a buddy's account
EDIT 3 ANSWER
Well, after a few hours of tinkering, here is the setup that i got to work.
First I deleted any existing checkouts, and killed the deamon. Then I set all the permissions to 774 for all my repositories (see below) Next, I ran the daemon with this command sudo -u svn -- svnserve -d -r /storage/svn/ This allowed me to run the deamon as the user 'svn' without entering a password. (svn has no password or shell for security reasons) Finally, I double checked all my config files, and was able to do checkouts exactly as hoped. Repositories Directory
drwxr-xr-x 6 root root 4096 2011-06-07 10:34 .
drwxr-xr-x 4 root root 4096 2011-06-05 00:48 ..
lrwxrwxrwx 1 svn svn 6 2011-06-06 22:35 all -> repos/
drwxrwxr-- 6 svn svn 4096 2011-06-06 13:53 EmpowerView
drwxrwxr-- 6 svn svn 4096 2011-06-06 13:54 GoogleVoicemail
-rwxrwxr-- 2 svn svn 307 2011-06-07 08:47 passwd
drwxrwxr-- 6 svn svn 4096 2011-06-06 13:54 PerlinNoise
drwxrwxr-- 7 svn svn 4096 2011-06-05 02:15 repos
-rwxrwxr-- 3 svn svn 2273 2011-06-07 09:50 svnserve.conf
(Note: All of my repositories share common editors and permissions, so in each repositories conf/ folder, i put hardlinks to the passwd and svnserve.conf files above)
Probably the svn daemon has read permission to your repository but not write permission.
First find out under what user the svn daemon runs. Then chown the full repository to that user. That way the daemon can write your commits also.
Weird things happen when you commit, or checkout as root. Try to checkout a given repository not as root, and if that works you should be able to commit to it as a regular user thereafter.
If that still doesn't work, check the permissions on the repository itself. It's possible that the permissions aren't set in order to allow non-root users commit access.
精彩评论