Subversion Server

FreeBSD

Installing Subversion server on FreeBSD using svnserve
Subversion verwenden

$ pkg search subversion
subversion-1.8.10_3
subversion16-1.6.23_8
subversion17-1.7.18
[...]

$ pkg install subversion-1.8.10_3

$ pw groupadd svn;
$ pw adduser svn -g svn -s /usr/sbin/nologin
$ mkdir -p /usr/home/svn/repos
$ chown -R svn:svn /usr/home/svn

$ vi /etc/rc.conf
svnserve_enable="YES"
svnserve_data="/usr/home/svn/repos"

$ service svnserve start
Starting svnserve.

$ ps aux | grep svn
svn     1988   0.0  0.1  54360  4216  -  Ss   11:00AM  0:00.00 /usr/local/bin/svnserve -d --listen-port=3690 --listen-host 0.0.0.0 -r /usr/home/svn/repos

$ sockstat | grep svnserve
svn      svnserve   1988  3  tcp4   *:3690                *:*

$ svnadmin create /usr/home/svn/repos/myfirstrepo
$ cd /home/svn/repos/myfirstrepo/conf

$ vi passwd
andreas = andreas-secret

$ vi authz
[/]
andreas = rw

$ vi svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = My First Repository
[...]

FAQ

Couldn’t open rep-cache database

Compiling Subversion 1.8

tortoise_svn_commit_rep-cache
$ svn checkout file:///usr/home/svn/repos/myfirstrepo
svn: E200029: Couldn't perform atomic initialization
svn: E200030: SQLite compiled for 3.8.7.2, but running with 3.8.5

$ pkg info subversion | grep Version
Version        : 1.8.10_3

$ pkg info sqlite3 | grep Version
Version        : 3.8.5_1

$ pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking for upgrades (31 candidates): 100%
The following 30 packages will be affected (of 0 checked):

New packages to be INSTALLED:
        [...]

Installed packages to be UPGRADED:
        sqlite3: 3.8.5_1 -> 3.8.7.2
        [...]

Installed packages to be REINSTALLED:
        [...]

Proceed with this action? [y/N]: y
[...]
Fetching sqlite3-3.8.7.2.txz: 100%  685 KB 701.0k/s    00:01
[...]
[27/30] Upgrading sqlite3 from 3.8.5_1 to 3.8.7.2: 100%
[...]

$ svn checkout file:///usr/home/svn/repos/myfirstrepo
A    myfirstrepo/tags
A    myfirstrepo/trunk
A    myfirstrepo/branches
Checked out revision 1.

txn-current-lock: Permission denied

$ svn checkout file:///home/svn/repos/project_2015_08_31_a
$ mkdir test
$ cd project_2015_08_31_a
$ echo "hallo" > test/welt
$ svn add test
A         test
A         test/welt

$ svn commit -m "add test"
svn: E000013: Commit failed (details follow):
svn: E000013: Can't open file '/home/svn/repos/project_2015_08_31_a/db/txn-current-lock': Permission denied

$ cd /home/svn/repos
$ ls -la
drwxr-xr-x  6 root  svn  512 Aug 31 10:46 project_2015_08_31_a

$ chown -R svn:svn project_2015_08_31_a
$ /usr/local/etc/rc.d/svnserve restart
=> use sockets (--listen-port=3690 --listen-host 0.0.0.0)
$ svn checkout svn://localhost/project_2015_08_31_a/
$ mkdir test
$ cd project_2015_08_31_a
$ echo "hallo" > test/welt
$ svn add test
A         test
A         test/welt

$ svn commit -m "add test"
svn: E170001: Commit failed (details follow):
svn: E170001: Authorization failed

Use username/password.
Edit repository configuration.

$ svn checkout svn://localhost/project_2015_08_31_a/
Authentication realm: <svn://localhost:3690> My First Repository
Username: andreas
Password for 'andreas': ********
Checked out revision 0.

$  cd project_2015_08_31_a
$  mkdir test
$  echo "hallo" > test/welt
$  svn add test
A         test
A         test/welt
$ svn commit -m "add test"
Adding         test
Adding         test/welt
Transmitting file data .
Committed revision 1.

$  echo "welt" > test/hallo
$ svn add test/welt
$ svn add test/hallo
A         test/hallo
$ svn commit -m "add test"
Adding         test/hallo
Transmitting file data .
Committed revision 2.

Leave a Reply

Your email address will not be published. Required fields are marked *