Personal tools
You are here: Home Linux Version Control Ecru - A private version control for configuration management (subversion)

Ecru - A private version control for configuration management (subversion)

Howto install subversion for a local repository without http access. External access is only provided via SvnServe

 

To a standard VM, apply updates, and install the standard RPM's. SubVersion is part of the CentOS base repository. Use yum to install it (Note: The i386 version wanted to be installed, so I splicitly installed the 64bit version only).

# yum install subversion.x86_64

Create a repository 

# svnadmin create /home/svn

SvnServe

 

Copy the example init script [2]. 
# chmod +x /etc/init.d/svnserve
# chkconfig --add svnserve
# chkconfig svnserve on
# adduser -r -M -c "SubVersion" svn

Edit the SvnServer configuration file '/etc/sysconfig/svnserve'. The root parameter must refer to the repository path created above.

OPTIONS="--listen-host=127.0.0.1 --root=/home/svn"

Create the SvnServer configuration '/home/svn/conf/svnserve.conf'

[general]
anon-access = none
password-db = passwd
# authz-db = authz
realm = Lucid Solutions

Add a username and password to '/home/svn/conf/passwd'. Change the ownswership of the entire SVN repositiry to be owned by the 'svn' user. The svnserve daemon runs as the 'svn' user.

# chown -Rv svn.svn /home/svn

Lastly start the SvnServe daemon

# service svnserve start

Using the repository

 Access is only via ssh. The svnserver process is only listening on the loopback interface. The local firewall prevents all access except ssh.

Links

Appendices

[1] Installation info

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 subversion              x86_64     1.4.2-2.el5      base              2.4 M
Installing for dependencies:
 apr                     x86_64     1.2.7-11         base              118 k
 apr-util                x86_64     1.2.7-6          base               73 k
 neon                    x86_64     0.25.5-5.1       base               94 k
 perl                    x86_64     4:5.8.8-10.el5_0.2  updates            12 M
 perl-URI                noarch     1.35-3           base              116 k
 postgresql-libs         x86_64     8.1.11-1.el5_1.1  updates           195 k

Transaction Summary
=============================================================================
Install      7 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 15 M
Is this ok [y/N]:

[2] SvnServe init script '/etc/init.d/svnserve'

#!/bin/bash
#
# svnserve        Startup script for svnserve
#
# chkconfig: - 85 15
# description: Subversion server
# processname: svnserve
# config: /etc/sysconfig/svnserve
# pidfile: /var/run/svnserve.pid 
# Source function library.
 
. /etc/rc.d/init.d/functions 
 

if [ -f /etc/sysconfig/svnserve ]; then
        . /etc/sysconfig/svnserve
fi
 
pidfile=${PIDFILE-/var/run/svnserve.pid}
lockfile=${LOCKFILE-/var/lock/subsys/svnserv}
 
start() {
        echo -n $"Starting $prog: "
        daemon --user svn svnserve --daemon $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        return $RETVAL
}
stop() {
        echo -n $"Stopping $prog: "
        killproc svnserve
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
 
# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status svnserve
        RETVAL=$?
        ;;
  restart)
        stop
        start
        ;;
  condrestart)
        if [ -f ${pidfile} ] ; then
                stop
                start
        fi
        ;;
  *)
        echo $"Usage: $prog {start|stop|restart|condrestart|status}"
        exit 1
esac
 
exit $RETVAL

 

Document Actions