Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

svnserve launchd item for OS X 10.4

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.

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

Comments on this post

jmay posts on Jan 16, 2006 at 06:13
The launchctl command as described above didn't work for me under 10.4.

This worked:

sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve

sudo launchctl start org.tigris.subversion.svnserve
incognito posts on Jan 22, 2006 at 22:46
Thanks! I've updated it to reflect your correction.
dlepiane posts on May 23, 2006 at 22:26
Couple recommendations:

1) file shoudl be saved with .plist extension (more conventional in Mac OS)
2) launch commands should be fixed :

sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist
sudo launchctl start org.tigris.subversion.svnserve

jmay gave the correct launchctl start command, but looks like you have a copy&paste error, incognito.

Oh, one other note, Subversion can be downloaded as a proper binary package from here: http://metissian.com/projects/macosx/subversion/

Thanks :D
soul8o8 posts on Jun 21, 2006 at 14:41
The latest version of svn uses IPv6. If you get a "Connection refused" try adding:

...
<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>

</dict>
...

Note the extra array-tag.
Then

sudo launchctl unload /Library/LaunchDaemons/org.tigris.subversion.svnserve
sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve
sudo launchctl start org.tigris.subversion.svnserve

Thanks to http://marc.baffl.co.uk/stuff.php
soul8o8 posts on Jun 21, 2006 at 14:43
sorry, should be
<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>
incognito posts on Aug 23, 2006 at 15:24
Thanks, guys. Post has been updated to reflect all your wonderful input.
deltalanguage posts on Sep 04, 2006 at 05:26
With the 10.4.7 security patch to launchd, the above generates a "Bonjour Workaround" error. The following is the proper PLIST for what you wish to do. NOTE: you can change the user+group names and repository locations to suite your needs. Additionally, you should replace the string "/usr/local/darwinports/bin/svnserve" with the result of "sudo which `svnserve`" when typed at the terminal. The following is a correct, tested PLIST for 10.4.7 (filename /Library/LaunchDaemons/org.tigris.subversion.plist):

<?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>Label</key>
<string>org.tigris.subversion</string>
<key>UserName</key>
<string>SVN</string>
<key>GroupName</key>
<string>SVN</string>
<key>Program</key>
<string>/usr/local/darwinports/bin/svnserve</string>
<key>ProgramArguments</key>
<array>
<string>svnserve</string>
<string>-i</string>
<string>-r</string>
<string>/Users/SVN/Documents</string>

<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>Bonjour</key>
<true/>
<key>SockServiceName</key>
<string>svn</string>
</dict>
</dict>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
</dict>
</plist>
deltalanguage posts on Sep 04, 2006 at 05:26
With the 10.4.7 security patch to launchd, the above generates a "Bonjour Workaround" error. The following is the proper PLIST for what you wish to do. NOTE: you can change the user+group names and repository locations to suite your needs. Additionally, you should replace the string "/usr/local/darwinports/bin/svnserve" with the result of "sudo which `svnserve`" when typed at the terminal. The following is a correct, tested PLIST for 10.4.7 (filename /Library/LaunchDaemons/org.tigris.subversion.plist):

<?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>Label</key>
<string>org.tigris.subversion</string>
<key>UserName</key>
<string>SVN</string>
<key>GroupName</key>
<string>SVN</string>
<key>Program</key>
<string>/usr/local/darwinports/bin/svnserve</string>
<key>ProgramArguments</key>
<array>
<string>svnserve</string>
<string>-i</string>
<string>-r</string>
<string>/Users/SVN/Documents</string>

<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>Bonjour</key>
<true/>
<key>SockServiceName</key>
<string>svn</string>
</dict>
</dict>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
</dict>
</plist>
deltalanguage posts on Sep 04, 2006 at 05:28
With the 10.4.7 security patch to launchd, the above generates a "Bonjour Workaround" error. The following is the proper PLIST for what you wish to do. NOTE: you can change the user+group names and repository locations to suite your needs. Additionally, you should replace the string "/usr/local/darwinports/bin/svnserve" with the result of "sudo which `svnserve`" when typed at the terminal. The following is a correct, tested PLIST for 10.4.7 (filename /Library/LaunchDaemons/org.tigris.subversion.plist):
<?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>Label</key>
        <string>org.tigris.subversion</string>
        <key>UserName</key>
        <string>SVN</string>
        <key>GroupName</key>
        <string>SVN</string>
        <key>Program</key>
        <string>/usr/local/darwinports/bin/svnserve</string>
        <key>ProgramArguments</key>
        <array>
                <string>svnserve</string>
                <string>-i</string>
                <string>-r</string>
                <string>/Users/SVN/Documents</string>
        </array>
        <key>Sockets</key>
        <dict>
                <key>Listeners</key>
                <dict>
                        <key>Bonjour</key>
                        <true/>
                        <key>SockServiceName</key>
                        <string>svn</string>
                </dict>
        </dict>
        <key>inetdCompatibility</key>
        <dict>
                <key>Wait</key>
                <false/>
        </dict>
</dict>
</plist>

deltalanguage posts on Sep 04, 2006 at 05:29
With the 10.4.7 security patch to launchd, the above generates a "Bonjour Workaround" error. The following is the proper PLIST for what you wish to do. NOTE: you can change the user+group names and repository locations to suite your needs. Additionally, you should replace the string "/usr/local/darwinports/bin/svnserve" with the result of "sudo which `svnserve`" when typed at the terminal. The following is a correct, tested PLIST for 10.4.7 (filename /Library/LaunchDaemons/org.tigris.subversion.plist):

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;org.tigris.subversion&lt;/string&gt;
        &lt;key&gt;UserName&lt;/key&gt;
        &lt;string&gt;SVN&lt;/string&gt;
        &lt;key&gt;GroupName&lt;/key&gt;
        &lt;string&gt;SVN&lt;/string&gt;
        &lt;key&gt;Program&lt;/key&gt;
        &lt;string&gt;/usr/local/darwinports/bin/svnserve&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;svnserve&lt;/string&gt;
                &lt;string&gt;-i&lt;/string&gt;
                &lt;string&gt;-r&lt;/string&gt;
                &lt;string&gt;/Users/SVN/Documents&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;Sockets&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;Listeners&lt;/key&gt;
                &lt;dict&gt;
                        &lt;key&gt;Bonjour&lt;/key&gt;
                        &lt;true/&gt;
                        &lt;key&gt;SockServiceName&lt;/key&gt;
                        &lt;string&gt;svn&lt;/string&gt;
                &lt;/dict&gt;
        &lt;/dict&gt;
        &lt;key&gt;inetdCompatibility&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;Wait&lt;/key&gt;
                &lt;false/&gt;
        &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;


deltalanguage posts on Sep 04, 2006 at 05:29
With the 10.4.7 security patch to launchd, the above generates a "Bonjour Workaround" error. The following is the proper PLIST for what you wish to do. NOTE: you can change the user+group names and repository locations to suite your needs. Additionally, you should replace the string "/usr/local/darwinports/bin/svnserve" with the result of "sudo which `svnserve`" when typed at the terminal. The following is a correct, tested PLIST for 10.4.7 (filename /Library/LaunchDaemons/org.tigris.subversion.plist):

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;org.tigris.subversion&lt;/string&gt;
        &lt;key&gt;UserName&lt;/key&gt;
        &lt;string&gt;SVN&lt;/string&gt;
        &lt;key&gt;GroupName&lt;/key&gt;
        &lt;string&gt;SVN&lt;/string&gt;
        &lt;key&gt;Program&lt;/key&gt;
        &lt;string&gt;/usr/local/darwinports/bin/svnserve&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;svnserve&lt;/string&gt;
                &lt;string&gt;-i&lt;/string&gt;
                &lt;string&gt;-r&lt;/string&gt;
                &lt;string&gt;/Users/SVN/Documents&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;Sockets&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;Listeners&lt;/key&gt;
                &lt;dict&gt;
                        &lt;key&gt;Bonjour&lt;/key&gt;
                        &lt;true/&gt;
                        &lt;key&gt;SockServiceName&lt;/key&gt;
                        &lt;string&gt;svn&lt;/string&gt;
                &lt;/dict&gt;
        &lt;/dict&gt;
        &lt;key&gt;inetdCompatibility&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;Wait&lt;/key&gt;
                &lt;false/&gt;
        &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;


deltalanguage posts on Sep 04, 2006 at 05:30
With the 10.4.7 security patch to launchd, the above generates a "Bonjour Workaround" error. The following is the proper PLIST for what you wish to do. NOTE: you can change the user+group names and repository locations to suite your needs. Additionally, you should replace the string "/usr/local/darwinports/bin/svnserve" with the result of "sudo which `svnserve`" when typed at the terminal. The following is a correct, tested PLIST for 10.4.7 (filename /Library/LaunchDaemons/org.tigris.subversion.plist):

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
&lt;key&gt;Label&lt;/key&gt;
&lt;string&gt;org.tigris.subversion&lt;/string&gt;
&lt;key&gt;UserName&lt;/key&gt;
&lt;string&gt;SVN&lt;/string&gt;
&lt;key&gt;GroupName&lt;/key&gt;
&lt;string&gt;SVN&lt;/string&gt;
&lt;key&gt;Program&lt;/key&gt;
&lt;string&gt;/usr/local/darwinports/bin/svnserve&lt;/string&gt;
&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
&lt;string&gt;svnserve&lt;/string&gt;
&lt;string&gt;-i&lt;/string&gt;
&lt;string&gt;-r&lt;/string&gt;
&lt;string&gt;/Users/SVN/Documents&lt;/string&gt;
&lt;/array&gt;
&lt;key&gt;Sockets&lt;/key&gt;
&lt;dict&gt;
&lt;key&gt;Listeners&lt;/key&gt;
&lt;dict&gt;
&lt;key&gt;Bonjour&lt;/key&gt;
&lt;true/&gt;
&lt;key&gt;SockServiceName&lt;/key&gt;
&lt;string&gt;svn&lt;/string&gt;
&lt;/dict&gt;
&lt;/dict&gt;
&lt;key&gt;inetdCompatibility&lt;/key&gt;
&lt;dict&gt;
&lt;key&gt;Wait&lt;/key&gt;
&lt;false/&gt;
&lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;
deltalanguage posts on Sep 04, 2006 at 05:32
Sorry about all the above posts, this silly computer is giving me an "Application Rails" error. Please disregard all but my first post. Thank you.

Once again, I apologize for all the other posts.
renderbox posts on Jul 09, 2007 at 23:07
When I run the following:
sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist

I get this error:

launchctl: opendir() failed to open the directory
nothing found to load

What I am not sure of is which path is missing? Can it not find the plist file or is there something wrong with the SVN repository path? It is really annoying because I can't seem to work around it. Any thoughts on what would cause this? Thanks in advance.


I am running 10.4.10
mtyranski posts on Jul 25, 2007 at 20:02
I have just installed the latest version of SVN on my Mac and I am having some trouble connection when using launchd to start it.

Here is my plist file

<?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>
<true/>
<key>GroupName</key>
<string>mike</string>
<key>Label</key>
<string>org.tigris.subversion.svnserve</string>
<key>OnDemand</key>
<true/>
<key>Program</key>
<string>/user/local/bin/svnserve</string>
<key>ProgramArguments</key>
<array>
<string>svnserve</string>
<string>--inetd</string>
<string>--root=/Users/mike/Desktop/svn/</string>

<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>

</dict>
<key>Umask</key>
<integer>2</integer>
<key>UserName</key>
<string>mike</string>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
</dict>
</plist>


I am able to load the plist file and start the service with no issue. However when I attempt to connect to to the repository, I see the following error in my SVN client...

Malformed Network Data

And in the console log on the server side, I see the following

launchproxy[15303] execv(): No such file or directory

When I run svnserve -X I am able to connect without issue.

Any thoughts??? Thanks!

I am on 10.4.8

You need to create an account or log in to post comments to this site.