Subversion server, installing
From NAS-Central Buffalo - The Linkstation Wiki
m (added note about update-rc.d) |
|||
| (5 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
{{Template:Articles}} | {{Template:Articles}} | ||
| - | This article describes setting up a simple Subversion server for your LAN using <tt>svnserve</tt>. You can choose more advanced configurations if you prefer (see [http://svnbook.red-bean.com/ http://svnbook.red-bean.com/] for more information). | + | This article describes setting up a simple [http://subversion.tigris.org Subversion] server for your LAN using <tt>svnserve</tt>. You can choose more advanced configurations if you prefer (see [http://svnbook.red-bean.com/ http://svnbook.red-bean.com/] for more information). |
1. First let's install Subversion. Use the command: | 1. First let's install Subversion. Use the command: | ||
| Line 10: | Line 10: | ||
<font color=red>apt-get install subversion-tools db4.4-util patch xml-core</font> | <font color=red>apt-get install subversion-tools db4.4-util patch xml-core</font> | ||
| - | 3. Create your repository. I like to use a directory that contains multiple repositories, one for each project | + | 3. Create your repository. I like to use a directory that contains multiple repositories, one for each project; <tt>svnserve</tt> is quite happy to serve all of them. For example, |
<font color=red>mkdir /home/svnrepos</font> | <font color=red>mkdir /home/svnrepos</font> | ||
| Line 33: | Line 33: | ||
PATH=/bin:/usr/bin:/sbin:/usr/sbin | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
| - | DAEMON=/usr | + | DAEMON=/usr/bin/svnserve |
REPOS=<font color=red>/home/svnrepos</font> | REPOS=<font color=red>/home/svnrepos</font> | ||
| Line 63: | Line 63: | ||
exit 0 | exit 0 | ||
| - | 5. Set your server to start at the correct runlevels. I did this | + | 5. Set your server to start at the correct runlevels. I did this by creating symbolic links to <tt>/etc/init.d/svnserve</tt>: I created <tt>/etc/rc1.d/K92svnserve</tt>, <tt>/etc/rc2.d/S92svnserve</tt>, <tt>/etc/rc3.d/S92svnserve</tt>, <tt>/etc/rc4.d/S92svnserve</tt>, <tt>/etc/rc5.d/S92svnserve</tt>. |
| + | |||
| + | Alternatively (on Ubuntu, at least), the following will start svnserve at runlevel 2, and stop it on runlevels 0 1 6: | ||
| + | |||
| + | update-rc.d svnserve start 92 2 . stop 92 0 1 6 . | ||
| + | |||
| + | {{Postit|Call for help! | Can someone confirm that 'update-rc.d' works on Debian as well as Ubuntu? }} | ||
[[Category:Debian]] | [[Category:Debian]] | ||
Latest revision as of 11:08, 7 September 2007
This article describes setting up a simple Subversion server for your LAN using svnserve. You can choose more advanced configurations if you prefer (see http://svnbook.red-bean.com/ for more information).
1. First let's install Subversion. Use the command:
apt-get install subversion
2. You may like to install these too:
apt-get install subversion-tools db4.4-util patch xml-core
3. Create your repository. I like to use a directory that contains multiple repositories, one for each project; svnserve is quite happy to serve all of them. For example,
mkdir /home/svnrepos svnadmin create /home/svnrepos/project1
4. Create /etc/init.d/svnserve as follows:
#! /bin/sh -e
#### BEGIN INIT INFO
# Provides: synserve
# Required-Start: $syslog $time $local_fs $remote_fs
# Required-Stop: $syslog $time $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Subversion repository server
# Description: Debian init script for the Subversion repository server
### END INIT INFO
#
# Author: Rick Beton
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/bin/svnserve
REPOS=/home/svnrepos
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting Subversion server" "svnserve"
$DAEMON -d -r $REPOS
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping Subversion server" "svnserve"
killproc $DAEMON
log_end_msg $?
;;
force-reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/svnserve {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
5. Set your server to start at the correct runlevels. I did this by creating symbolic links to /etc/init.d/svnserve: I created /etc/rc1.d/K92svnserve, /etc/rc2.d/S92svnserve, /etc/rc3.d/S92svnserve, /etc/rc4.d/S92svnserve, /etc/rc5.d/S92svnserve.
Alternatively (on Ubuntu, at least), the following will start svnserve at runlevel 2, and stop it on runlevels 0 1 6:
update-rc.d svnserve start 92 2 . stop 92 0 1 6 .
| Call for help! |
| Can someone confirm that 'update-rc.d' works on Debian as well as Ubuntu? |

