Sunday, September 6, 2009

Setup CVS server on Ubuntu

1. Install CVS client and server:

apt-get install cvs cvsd

With the default installation, the root for cvsd is at /var/lib/cvsd, and the bin, dev, etc, lib, tmp, and usr directories should be created during the install. The default repositories demo and myrepos are defined in the configuration file /etc/cvsd/cvsd.conf.

2. Start the CVS server:

sudo /etc/init.d/cvsd start

It looks like that the command /etc/init.d/cvsd status has problem to display the correct status of the CVS server, run following command to make sure if the server is running:

ps -def | grep cvsd

If the server is not running, modify the line with the word Listen in the configuration file /etc/cvsd/cvsd.conf:

from "Listen * 2401" to "Listen 0.0.0.0 2401".

Restart the server and check again.

3. Create myrepos and CVSROOT directories with following command (Note: the absolute path is needed to initialize the repose):

sudo cvs -d /var/lib/cvsd/myrepos init
sudo chown -R cvsd:cvsd /var/lib/cvsd/myrepos

The basic structures of cvsd and the repository $CVSROOT are ready.

4. Add user to the group cvsd and create the password for users.

From System->Administration->Users and Groups. Click Unlock button and enter the password, then click Manage Groups button. Highlight cvsd then click Properties and select the username from the Group Members list.

Create the user password for CVS login as shown below:

cvsd-passwd /var/lib/cvsd/myrepos username

5. The syntax to login to the local CVS server is shown below:

cvs -d :pserver:username@localhost:/myrepos login

However, if the $CVSROOT is defined just simply enter "cvs login" instead. Add following line in ~/.bashrc is the easiest way to add it to the environment.

export CVSROOT=:pserver:username@localhost:/myrepos

If log in has no problem, CVS should be working fine.

6. Following is the syntax to import an example tools project in the current directory to the repository. Please note that the CVS import function requires $CVSROOT defined.

cd tools
cvs import -m "Initial import into CVS" tools initial start

A new directory, tools, is created at /var/lib/cvsd/myrepos.

7. For any reason to completely uninstall cvsd, enter following command:

apt-get --purge remove cvsd

8. In Eclipse environment, the CVS repository location should be defined as /myrepos instead the full path.

2 comments:

Emir said...
This comment has been removed by the author.
Emir said...
This comment has been removed by the author.