Recent Articles

Running Subversion as Windows Service

You'll quickly notice that Subversion needs the svnserve.exe executable running at all times to be able to perform source control operations (checkin, checkout, merge, update, etc.). It's impractical on a Windows machine to have a command running at all times because as soon as you log out, the command gets killed. The usual way for this type of long running application is to have it running as a Windows service. Prior to 1.4, you needed to download separately a 3rd party application called SVNService to patch svnserve to run as service. It was a real hassle and if you try searching for it on Google, you'll notice the link is pretty much non-existent.

Fortunately, as of the new Subversion 1.4, you no longer need to patch the executable. The svnserve.exe can now run natively as Windows service. Here's the command you need to install svnserve into the Windows registry so it runs as a service:

sc create Subversion binpath= "C:\Program Files\Subversion\bin\svnserve.exe --service --root [PATH_TO_REPOSITORY]" displayname= "Subversion" depend= Tcpip

The [PATH_TO_REPOSITORY] assumes you already ran the following command to init the repository folder:

svnadmin create [PATH_TO_REPOSITORY]

NOTE: The space after the equal sign (=) is necessary or else the command will not run. This is slightly ackward but the program expects the space.

You can now run the service using net start Subversion or from the Service MMC snap-in.