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):
<code> <?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> </code>
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:
<code> $ cd ~cvs/CVSROOT $ sudo htpasswd -c passwd user1 $ sudo htpasswd passwd user2 # etc. </code>
Then, you’ll need a
<code> # launchctl load /Library/LaunchDaemons/cvspserver.list </code>
and you should be in business.
(At the next reboot, cvspserver.plist should be picked up by launchd.)
Start with this article.
—
–Chris Ryland, Em Software
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:
—
–Chris Ryland, Em Software