stephan-hein.de - Tech Start Page - CVS server MAC OS X

HowTo

Set up a CVS Server under MAC OS X 10.8 Mountain Lion

Introduction

A pserver is needed under MAC OS X similiar to the pserver under Unix/Linux. Under Unix a pserver process is initiated by the inetd root daemon. Under MAC OS X there is no inetd available. A similiar root process called Launch Server or Launchd is used under MAC OS X. Each process controlled by Launchd needs to be configured by a so called property list file or plist file.

Install XCODE and Command Line Tools

This is required to get cvs available.

After XCODE installation goto XCODE preferences and enable comand line tools. This installs all Unix comand line tools like cvs, gcc, make...

Create a CVS repository

It's supposed that in this example the cvs admin is a user called cvsuser. Therefore the repository is created in its Home-directory.


mkdir /Users/cvsuser/cvsroot

cvs -d /Users/cvsuser/cvsroot init

Afterwards a directory called CVSROOT has been created.

Create User passwords for each User under CVS repository

Here it is essential to use a password generator that fits to the cvs password verification. Some trials delivered that the often mentioned Apache comand htpasswd doesn't work on OS X 10.8. After some investigation I found openssl that generates the correct password for cvs.

Submit openssl with the passwd you use later in the cvs pserver login.


cd /Users/cvsuser/cvsroot/CVSROOT

openssl passwd
Password: 
Verifying - Password: 
Pw1QlAju7.E

Afterwards you need to add an entry to the manually created passwd file under CVSROOT. Add cvs-client-userid, the generated password and user-id of the cvs admin separated by colons.

The entry in the passwd file should look like this:
user1:Pw1QlAju7.E:cvsuser

user1 is the actual cvs user who does a login. cvsuser is the admin user where the repository is hosted. This name must be identical to value of "UserName" which is used by the launch control file. Pls. note that it is allowed that User1 and cvsuser are identical.

Create a launch control file for cvs pserver


<?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>cvsuser</string>
 <key>Program</key>
 <string>/usr/bin/cvs</string>
 <key>ProgramArguments</key>
 <array>
 <string>cvs</string>
 <string>-f</string>
 <string>--allow-root=/Users/cvsuser/cvsroot/</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>

Copy and Launch Control File


sudo cp cvspserver.plist /Library/LaunchDaemons
cd /Library/LaunchDaemons
sudo launchctl load cvspserver.plist

Verify loaded pserver


sudo launchctl list|grep cvs

Pls. note that it isn't necessary that the pserver process is active with an PID.

Start the CVS Server manually


sudo launchctl start com.apple.cvspserver