« Earlier 3 items total Later »

On this page: 

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


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 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>
                <dict>
                        <key>SockFamily</key>
                        <string>IPv4</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>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

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

svn co svn://your.host.name/aModule/In/Your/Repository

Restart lighttpd script

I use this script to avoid having to do the killall dance on my local dev box constantly when tweaking my lighttpd.conf

#!/bin/sh
sudo killall -9 lighttpd
sudo killall -9 ruby
sudo /opt/local/sbin/lighttpd -f /opt/local/etc/lighttpd.conf


Make the script executable (chmod u+x), put it in your path, invoke by simply typing the name of the script. This also kills off any ruby processes, which lighttpd will restart when it reboots.

The path to lighttpd and the lighttpd.conf files are based on the installation from DarwinPorts - adjust as needed.

Lighttpd launchd item for OS X 10.4

Save the following in /Library/LaunchDaemons/net.lighttpd.plist to have lighttpd start automatically on any OS X 10.4 computer. Note that this assumes a working DarwinPorts lighttpd installation (otherwise you will need to change the paths to the lighttpd executable). Note that this also assumes that the lighttpd.conf file is in /opt/local/etc.

<?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>net.lighttpd</string>
        <key>OnDemand</key>
        <false/>
        <key>Program</key>
        <string>/opt/local/sbin/lighttpd</string>
        <key>ProgramArguments</key>
        <array>
                <string>/opt/local/sbin/lighttpd</string>
                <string>-f/opt/local/etc/lighttpd.conf</string>
                <string>-D</string>
        </array>
</dict>
</plist>

« Earlier 3 items total Later »