next up previous contents
Next: 4 FTP Up: Redhat FAQ Previous: 2 Big Brother   Contents

Subsections

3 CVS and RCS

3.1 CVS

3.1.1 Creating a Repository

  1. Log onto the server
  2. Set CVSROOT
    $ export CVSROOT=/var/cvs
  3. Create the necessary user and group
    $ sudo groupadd -g 105 cvs 
    $ sudo useradd -u 105 -g cvs -d $CVSROOT cvs
  4. Create the administrative directory
    $ sudo mkdir -p $CVSROOT/CVSROOT
  5. Set ownership and permissions
    $ sudo chown -R cvs:cvs $CVSROOT 
    $ sudo chmod -R ug+rwx $CVSROOT 
    $ sudo chmod -R o-rwx $CVSROOOT
  6. Become the cvs user
    $ sudo su - cvs
  7. Initialize the repository
    $ cvs init
  8. Logout from being cvs
  9. The repository is now prepared.

3.1.2 Setting up xinetd for cvs

This step is not necessary if you are using ssh for access

  1. Create the file /etc/xinetd.d/cvs 
     
    # cvs server 
     
    service cvspserver 
    { 
     socket_type   = stream 
     protocol      = tcp 
     wait          = no 
     user          = cvs 
     passenv       = PATH 
     server        = /usr/bin/cvs 
     server_args   = -f -allow-root=/var/cvs pserver 
     disable       = no 
    }
  2. Reload the xinetd configuration
    $ sudo service xinetd reload

3.1.3 Pserver Passwords

If you are using pserver then passwords are needed. CVS cannot use the MD5 hash so just copying system passwords is out on Linux. Use openssl:

$ openssl passwd -crypt <password>

Paste the result into the the password field in $CVSROOT/CVSROOT/passwd. The crypt function only uses the first eight characters.

3.1.4 Checking out files using pserver

  1. Set CVSROOT
    $ export CVSROOT=:pserver:<user>@thames:/var/cvs
  2. Create a directory to store checked out files
    $ mkdir ~/cvs 
    $ cd ~/cvs
  3. login to the CVS server
    $ cvs login
  4. Checkout a new tree if necessary
    $ cvs checkout <module name>
  5. Change to the correct directory
  6. Check if file to be edited is up to date
    $ cvs status <filename>
  7. If necessary, get lastest versions
    $ cvs update <filename>
  8. Make needed changes
  9. Upload changes
    $ cvs commit <filename>
  10. If you do not want to keep the files around
    $ cvs release -d <path/to/directory/to/delete>
  11. Logout
    $ cvs logout

3.2 RCS

RCS is useful for maintaining configuration files on a local macine where CVS would be overkill.

3.2.1 Creating and checking in files

  1. Change to the directory the config files are in
    $ cd /home/dnsadmin/data
  2. Make the RCS directory if necessary
    $ mkdir RCS
  3. Add a file
    $ rcs -i totalflood
  4. Check the file in
    $ ci totalflood

3.2.2 Editing the RCS managed file

  1. Check the file out for editing
    $ co -l totalflood
  2. Edit the file
  3. Check the file back in. This also creates a read only copy for use
    $ ci -u totalflood

3.2.3 Access

To insure that only authorized users edit files you can create an access list for a file.

$ rcs -a<username> <file>

3.3 Clients

3.3.1 Cervesia

3.3.1.1 To add a new project directory

  1. Make sure cvs group has write permission to the cvs directory (/var/cvs) on the server. If the permissions do not allow group writes add a directory for the new project.

    1. Log into the cvs server
    2. Become cvs user
      $ sudo su - cvs
    3. Create the new directory
      $ mkdir /var/cvs/foobar
    4. Set permissions
      $ chmod ug+w /var/cvs/foobar
  2. Start Cervisia
  3. Select Repository->Import
  4. Select the correct repository. eg: ext:user@thames:/var/cvs
  5. Select a module name: foobar
  6. Give the complete path to the Working Directory.
  7. Enter a Vendor Tag and ReleaseTag.
  8. Click ``OK''
  9. Check the project directory back out


next up previous contents
Next: 4 FTP Up: Redhat FAQ Previous: 2 Big Brother   Contents
2005-03-20