Search
Free Signup | Login
Search Articles
Topics
Article List
Article Archive
Relevant Links
Running Subversion as Windows Service
Location: BlogsRevindexWindows    
Posted by: revindex 7/15/2007 4:28 PM

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.

Permalink |  Trackback

Comments (5)   Add Comment
Re: Running Subversion as Windows Service    By Per Turner on 6/12/2008 10:29 AM
Thanks, just what i was looking for and it worked like a charm!

Re: Running Subversion as Windows Service    By Bernhard Hofmann on 11/24/2008 9:40 AM
Great advice, but remember that the command line you use must be running with Administrator rights. Edit the properties of the command line link and on the [Shortcut] tab, press the [Advanced...] button and then tick the [Run as administrator] option. Press OK twice to close the properties and then run the command line. You might be prompted to continue with administrator rights.

Re: Running Subversion as Windows Service    By slim on 11/24/2008 11:35 AM
Thanks for the tip!

Re: Running Subversion as Windows Service    By Cem Gencer on 11/25/2008 3:45 PM
add a start= auto to start the service automatically...

Re: Running Subversion as Windows Service    By slim on 11/25/2008 4:29 PM
It's been a long while. I have since used VisualSVN server for free. You can download it at http://visualsvn.com

The free server runs the same Subversion underneath and can manage multiple repositories and Win auth permissions easily. If you can afford the client, I suggest you get that too. It beats AnkhSVN by a wide margin.


Your name:
Title:
Comment:
Add Comment   Cancel