Welcome to

LINUX WORLD

Rohit Mehta : A Linux Follower

bangalore, Karnataka, India
hi! i m a person who is chill all time. Since jan 2008 i am working for Novell software. The word Impossible does not exist in my dictionary because Impossible says i m possible...hey guys have fun with linux...it begins but has no end......

Monday, November 16, 2009

Using `cvsd’ to setup cvs pserver





http://funlinuxfun.blogspot.com/
CVS was designed to use `xinetd’ to startup service. But now most Linux distributions do not install xinetd by default, and configuration of CVS is somewhat complicated. `cvsd‘ is a wrapper program for CVS in pserver mode, it can startup CVS as a standalone daemon, under a special uid/gid in a chroot jail. It is relatively easy to use cvsd and its configuration file to setup CVS repositories.
In this article, I will describe how to setup a cvs pserver step by step.
1. Installation of cvsd package
For RPM-based distributions, you may download precompiled RPMS from this site:
For other distributions, you may download source tarball here, compile and install it yourself.

2. Configuration file /etc/cvsd/cvsd.conf
Check cvsd’s configuration file /etc/cvsd/cvsd.conf. Something should be mentioned:
  • RootJail: the location of the chroot jail cvs should be run in. The default value should like


    RootJail /var/lib/cvsd
    For RPM-based installation, the installation process should have initialized this directory for you, by the command
    # cvsd-buildroot /var/lib/cvsd
    If the directory is not initialized yet, or you change `RootJail’ to another directory, you need to use the command `cvsd-buildroot’ to initialize it by hand.


  • Uid and Gid: the user and group cvsd should be run as. The default values:


    Uid cvsd
    Gid cvsd

    For non-RPM based installation, you need to create them by hand.


  • Repos: paths to repositories, one repository per line. Every path is relative to RootJail and begins with a `/’. For example:


    Repos /coolsoft
    Repos /hotsoft



3. Creation of repositories
To create a repository, for example, `coolsoft’, use the command:
# cvs -d /var/lib/cvsd/coolsoft init
The command will create a directory /var/lib/cvsd/coolsoft and a CVSROOT tree in it.
If you allow users to create top level directories in this repository:
# chown cvsd:cvsd /var/lib/cvsd/coolsoft
Edit the file /var/lib/cvsd/coolsoft/CVSROOT/config and modify the `LockDir’ option:
LockDir /tmp/coolsoft
The directory is relative to `RootJail’, /var/lib/cvsd. Create the directory:
# mkdir /var/lib/cvsd/tmp/coolsoft
# chown cvsd:cvsd /var/lib/cvsd/tmp/coolsoft

Now create users that can access this repository and set the passwords:
# cvsd-passwd /var/lib/cvsd/coolsoft jack
If you want anonymous access to your repository, create a user named `anonymous’ or `anoncvs’, and leave the password blank:
# cvsd-passwd /var/lib/cvsd/coolsoft anoncvs
Create a new file /var/lib/cvsd/coolsoft/CVSROOT/writers:
# touch /var/lib/cvsd/coolsoft/CVSROOT/writers
to protect write access to the repository. Without this file, all users have write access! Add users you want write access to this file, one user per line.
Optional, create top level directories in your repository that will hold files committed:
# cd /var/lib/cvsd/coolsoft
# mkdir client server
# chown cvsd:cvsd client server

4. Startup cvsd and test your repositories
To startup cvsd, use the command
# /etc/init.d/cvsd start
To test the new repository:
# cvs -d :pserver:jack@myhost.at.office/coolsoft login
# cvs -d :pserver:jack@myhost.at.office/coolsoft co client


No comments:


Which Linux distribution has ease of use?