AFP548 Changing the world one server at a time.

Servers and Services

CVS pserver launchd item for OS X 10.4

By ChrisRyland 1 min read

Inspired by the recent excellent launchd overview on afp548, I needed to set up a CVS pserver on our new Tiger Xserve box, migrating from an old Linux server.Here’s a recipe that seems to work.

You’ll need to create a launchd control file, call it cvspserver.plist, and put it in /Library/LaunchDaemons (where local launch control files are supposed to live):

<?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>com.apple.cvspserver</string>
        <key>UserName</key>
        <string>cvs</string>
        <key>Program</key>
        <string>/usr/bin/cvs</string>
        <key>ProgramArguments</key>
        <array>
                <string>cvs</string>
                <string>-f</string>
                <string>--allow-root=/Users/cvs</string>
                <string>pserver</string>
        </array>
        <key>Sockets</key>
        <dict>
                <key>Listeners</key>
                <dict>
                        <key>SockPassive</key>
                        <true/>
                        <key>SockServiceName</key>
                        <string>cvspserver</string>
                        <key>SockType</key>
                        <string>SOCK_STREAM</string>
                </dict>
        </dict>
        <key>inetdCompatibility</key>
        <dict>
                <key>Wait</key>
                <false/>
        </dict>
</dict>
</plist>

You’ll have to change the --allow-root=/Users/cvs CVS root specification above to match your actual root, but otherwise the above should work.

Next, it doesn’t appear that cvs under Tiger can access the standard user/password database, so you’ll have to create a password file in your $CVSHOME/CVSROOT directory:

$ cd ~cvs/CVSROOT
$ sudo htpasswd -c passwd user1
$ sudo htpasswd passwd user2 # etc.

Then, you’ll need a

# launchctl load /Library/LaunchDaemons/cvspserver.list

and you should be in business.
(At the next reboot, cvspserver.plist should be picked up by launchd.)

0 comments

  1. I need to make a correction: for this to work with a CVSROOT/passwd
    scheme (where the server has to setuid to the accessing user), the
    UserName value should be root, not cvs, as in:

    
    <key>UserName</key>
            <string>root</string>
    

    —

    –Chris Ryland, Em Software

Leave a Reply