It's not that straightforward getting svnserve to work under launchd. I can't take the credit for this but I thought it would be useful to have it here on TextSnippets.
1) Install subversion if you don't have it already. Here's how with DarwinPorts.
Or just download it from metissian.com ...
2) Create your Subversion repository (for my own use, I used /Users/xyz/Repositories) e.g.
3) Place the following XML into a file named org.tigris.subversion.svnserve.plist in the /Library/LaunchDaemons directory.
You'll need to change xyz to your user name ...
4) Test it out by doing a
1) Install subversion if you don't have it already. Here's how with DarwinPorts.
sudo port install subversion
Or just download it from metissian.com ...
2) Create your Subversion repository (for my own use, I used /Users/xyz/Repositories) e.g.
svnadmin create /Users/xyz/Repositories
3) Place the following XML into a file named org.tigris.subversion.svnserve.plist in the /Library/LaunchDaemons directory.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Debug</key> <false/> <key>GroupName</key> <string>xyz</string> <key>Label</key> <string>org.tigris.subversion.svnserve</string> <key>OnDemand</key> <true/> <key>Program</key> <string>/opt/local/bin/svnserve</string> <key>ProgramArguments</key> <array> <string>svnserve</string> <string>--inetd</string> <string>--root=/Users/xyz/Repositories</string> </array> <key>ServiceDescription</key> <string>SVN Version Control System</string> <key>Sockets</key> <dict> <key>Listeners</key> <array> <dict> <key>SockFamily</key> <string>IPv4</string> <key>SockServiceName</key> <string>svn</string> <key>SockType</key> <string>stream</string> </dict> <dict> <key>SockFamily</key> <string>IPv6</string> <key>SockServiceName</key> <string>svn</string> <key>SockType</key> <string>stream</string> </dict> </array> </dict> <key>Umask</key> <integer>2</integer> <key>UserName</key> <string>xyz</string> <key>inetdCompatibility</key> <dict> <key>Wait</key> <false/> </dict> </dict> </plist>
You'll need to change xyz to your user name ...
4) Test it out by doing a
sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist sudo launchctl start org.tigris.subversion.svnserve svn co svn://your.host.name/aModule/In/Your/Repository
This worked:
sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve
sudo launchctl start org.tigris.subversion.svnserve