Subversion 1.9 on Debian Jessie

If you would like to use the latest version of Subversion and prefer using the package manager like me, the following steps below will enable you to install Subversion 1.9 from the WanDisco repositories. At the time of writing, the latest version in the WanDisco repo is 1.9.2.

# download the GPG key of the repository and add it to apt:
wget -O /tmp/wandisco-debian.gpg
# add downloaded key to apt
apt-key add /tmp/wandisco-debian.gpg
# create apt sources file for wandisco repo
echo "deb jessie svn19" > /etc/apt/sources.list.d/wandisco.sources.list
# update apt and upgrade packages
apt-get update ; apt-get install subversion subversion-tools

It is important to note that the subversion install on Debian Jessie does not include a systemd start script for svnserve. This problem can easily be solved with the service start script provided below. Create an executable file at /etc/init.d/svnserve with the contents below. Note the OPTIONS line in the script below will need to be updated to reflect your specific environment.

#!/bin/sh -e
# Provides:          subversion
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.

test -f /usr/bin/svnserve || exit 0

OPTIONS="-d -T -r /srv/svn --log-file /var/log/svn.log"

case "$1" in
  echo -n "Starting subversion daemon:"
  echo -n " svnserve"
  start-stop-daemon --start --quiet --oknodo --chuid www-data:www-data --exec /usr/bin/svnserve -- $OPTIONS
  echo "."

  echo -n "Stopping subversion daemon:"
  echo -n " svnserve"
  start-stop-daemon --stop --quiet --oknodo --exec /usr/bin/svnserve
  echo "."


  $0 restart

  $0 stop
  $0 start

  echo "Usage: /etc/init.d/svnserve(start|stop|reload|restart)"
  exit 1


exit 0

Once your script is in place and set as executable, you can test it with the command below. Assuming your test succeeds, you can then instruct systemd to start the service at boot time.

# Test our new svnserve service
/etc/init.d/svnserve start
# Enable at boot in systemd
update-rc.d svnserve enable
Did you find this article useful? Why not share it with your friends?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.