|
Project: Linux Howtos
Configuring CVS and CVSUP on Linux
By Mahantesh.M.Vantmuri <mantu_v@softhome.net>
Posted: ( 2003-06-02 14:47:22 EST by prakash )
CVS is extensively used poen source version control system. CVSUP is a tool designed to synchronise the CVS repositories. This artile shows how to setup cvs and CVCUP so that CVS can be accessed from multiple locations.
Installation of CVS and CVSUP
Installing CVS on Redhat Linux 7.1/7.2/7.3
The following steps give simple steps to install CVS software on Redhat Linux 7.1/7.2/7.3
1) Download the tarball cvs-1.11.1p1.tar.gz from http://www.cvshome.com
2) Run “gunzip cvs-1.11.1p1.tar”. You will get file called
cvs-1.11.1p1.tar.
3) Then extract this file using command
“tar –xvf cvs-1.11.1p1.tar”.
4) Then go to directory cvs-1.11.1p1.
5) There you will find a file called INSTALL. Read it once carefully.
6) Now run the command “./configure.”
7) Build it using the command “make”.
8) Install binaries/documentation using command “make install”.
9) Now open file called /etc/services and add the following lines.
Cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations
10) Open file called /etc/xinetd.conf and add the following lines to
that file.
service cvspserver
{
Port = 2401
socket_type = stream
protocol = tcp
wait = no
user = root
passenv =
server = /opt/bin/cvs
server_args = --allow-root=/home/cvs -f pserver
env = HOME=/home/cvs
log = /var/log/cvslog
}
11) Space on both sides of = in the above file is a must.
12) Restart xinetd services by running command “ services xinted
restart “
13) Check whether CVS is running on the port 2401 by using the
following command “nmap 192.168.16.17 |grep 2401”. If the CVS server is
running correctly it will give output as “2401/tcp open
cvspserver ”.
14) Suppose you want to put my CVS repository at /home/cvs. Then create
an environmental variable called CVSROOT which points to /home/cvs.
15) Create the actual repository by the command “cvs -d /home/cvs
init”.
16) Create a link to /etc/password to file called passwd.
17) Now go to the client machine and install the Wincvs available from
//titan/software/cvs.
18) Open Wincvs window. Go to admin>>preferences.
19) At the ‘Enter CVSROOT’ field enter
“:pserver:username@cvsserver_name:/home/cvs”.
20) In the Authentication field select “ password file on cvs server”.
21) Now it is time to create to new modules. In Wincvs client go to
Create>>Import module. Select the folder from which you want to
create the module.
22) Then in “import settings” dialog box enter the module name as
whatever you want. Mention vendor tag and release tag appropriately. You
can also give log message that is associated with this module.
23) Now any other client machine access the same modules
24) To access the modules from other machines, open wincvs client in
that machine. Repeat steps 18 and 19.
25) Now click on Admin>>login. It will ask for the password.
Supply the correct password.
26) Then go to Create checkout module. In “ Enter the module name field
give the module name you created in the above steps”
27) In the field “local folder to checkout to” give the path of the
folder wherever you want to put your files.
28) Start using CVS as usual.
Installing CVSup server and CVSUP-client:
Background: CVSup is a tool that replicates multiple CVS repositories including the version information of the CVS files. CVSup requires modula-3 for compiling the and building.
First let us see how to install modula-3
Installing modula-3:
1) Download files ezm3-1.0-LINUXLIBC6-boot.tar.bz2 and
ezm3-1.0-src.tar.bz2 from
http://www.polstra.com/projects/freeware/ezm3/
2) Unpack the two files. This will create directory "ezm3-1.0"
containing all of the source files.
3) Run command “ cd ezm3-1.0”.
4) Run gmake. (This step assumes that the application GNU make is
already installed on the system. This will come by default with RH Linux
7.1)
5) Step (4) will take approximately around 10 minutes. This is enough
to install modula-3.
Installing CVSup server:
1) Download cvsup-16.1.tar.gz from http://www.polstra.com/projects/
2) Untar the sources: Run “gunzip cvsup-16.1.tar.gz” And then “tar
–xvf cvsup-16.1.tar”.
3) Run make.
4) Run make install. This will install both the CVSup Server and CVSup
Client.
Configuring CVSup server for replication
1) Suppose we have repository at /home/cvs. And assume that we have a
module called “testmodule”. This module should be replicated to all the
cvsup clients. So we need to define it as the collection in CVSup
server. For this create a directory say in /home/mahantesh. Name this
directory as base. In base folder create a folder called ‘sup’. In sup
folder create a folder called testmodule.
2) In testmodule folder create a file called list.cvs. This file
defines what this cvsup is giving to be replicated. So we need to
mention module name here. According to our assumption above we will
mention a line similar to “upgrade testmodule”
3) In the same folder create a file called ‘releases’. In this file we
have to give where the repository resides. So this file will contain
line similar to cvs list=list.cvs prefix=prefix where prefix is
/home/cvs.
4) Then go to /usr/local/sbin (where cvsupd deamon resides. Run the
command “./cvsupd -b /home/mahantesh/base/ -C 5 -l /home/mahantesh/log”.
This command starts the cvsupd server using /home/mahantesh/base as the
collection and create log in /home/mahantesh/log. ‘ –c 5’ indicates
that 5 clients can connect simultaneously.
Configuring the Client machines to get the updates from CVSup server.
1) On Client machine also perform the steps described in section
“Installing CVSup server”.
2) Create file called supfile in directory say /usr/local/bin (you can
create anywhere). The contents of the supfile will look like this.
*default umask=2
*default tag=.
*default host=
*default prefix=/home/cvs
*default base=/usr/local/etc/cvsup
*default release=cvs delete use-rel-suffix compress
testmodule
3) The first line shows the default umask of the system. The ‘default
tag’ indicates the current tag. The ‘default host’ indicates server from
which to get the updates. The default prefix indicates where to put the
updates from the server. The ‘default base’ indicates the default base
folder. The last line without * indicates which modules to get from
CVSup server.
4) Then from client machine run the command “cvsup supfile”. For each
run of this command client will get update from the server. So with cron
utility we need to schedule it for every one hour so that client can
get the updates everyone hour.
Thus a CVSup server should only push the entries from modules that are
local to its own cvs server. In the assumption above we declared
testmodule as the collection for CVSUP server. So it is local module for
the server.
We can run client as well server on the same machine. Then above
procedure has to be repeated on the servers and clients which are
involved in the files sharing.
Other articles by Mahantesh.M.Vantmuri
Current Rating: [ 6.33 / 10 ]
Number of Times Rated: [ 83 ]
|