Starting subversion from init.d

If you'd like to start subversion automatically from init.d, you can do the following

  • kill the running process if it exists
pskill svnserve
  • download the svnserve init.d script
cd /etc/init.d/
mv svnserve.txt svnserve
chmod 755 svnserve
  • Edit the script

The “stop” functionality of the above script is broken, follow these steps to fix it:

# update the host and repository
HOST=<IP or domain>
REPOSITORY=/var/svn # or another path if you like

#move the line PIDFILE before DAEMON_ARGS
DAEMON_ARGS="-d --pid-file $PIDFILE --listen-host $HOST --listen-port $PORT -r $REPOSITORY"
#note that I added --pid-file $PIDFILE to make sure svnserve writes 
#his PID to the correct location (so stop/restart knows where to find it)
  • Create the start / stop scrips
update-rc.d svnserve defaults
  • start svnserve 1)
/etc/init.d/svnserve start

The next time you restart your server, subversion will start automatically

1) this will start subversion listening on port 8080, if you want to use another port you'd have to edit the /etc/init.d/svnserve script and change the value of the PORT variable


Personal Tools