Вы находитесь на странице: 1из 3

Creating a cvs repository with pserver authentication http://www.korayguclu.de/index.php?&file=linux.cvs.pserver.

xml

Linux/Articles/CVS/pserver setup

» Creating a cvs repository with pserver authentication


» Home
» Publications
» Profile(CV) Step 1
» Contact Decide a cvs repository location (I use /usr/local/cvsroot) and set your CVSROOT variable.
It is a good idea to set this in a bash startup file e.g. /etc/profile
export CVSROOT=/usr/local/cvsroot
» Money
» Consulting
Step 2
be root and create a group and add as much users as you require.
» Markets [root@hermes dev]#/usr/sbin/groupadd cvsgrp
» Stock Tracker [root@hermes dev]#/usr/sbin/useradd -c "User Name" -g cvsgrp username
» Java.SCJP [root@hermes dev]#passwd username
» Java.Links
» Oracle.OCA
» Oracle.OCP Step 3
» Linux.Certification You have two options. You can move your existing repository from a windows cvs server or
» Linux.Articles you can create a new repository.
» Process.Agile
Step 3.1
If your are moving an existing repository from a windows server set the file and directory
» Microcontroller
permissions Your repository (/usr/local/cvsroot) should look like this
» Album
» Dictionary total 1
» Impressum drwxrwxr-x 3 kguclu cvsgrp 2003-05-24 19:25 CVSROOT
drwxrwxr-x 3 kguclu cvsgrp 2003-05-24 19:27 project

and the files under project directory looks like this


total 16
-r--r--r-- 1 kguclu cvsgrp 2003-05-24 19:27 book2menu.xsl,v
-r--r--r-- 1 kguclu cvsgrp 2003-05-24 19:27 document2html.xsl,v
-r--r--r-- 1 kguclu cvsgrp 2003-05-24 19:27 site2xhtml.xsl,v
-r--r--r-- 1 kguclu cvsgrp 2003-05-24 19:27 tab2menu.xsl,v
drwxrwxr-x 2 kguclu cvsgrp 2003-05-24 19:27 test

This gives necessary information about the directory permissions. If you are moving your
files from a windows file system you need to set the permissions manually you can search
for directories by using the following command under CVSROOT
find . -type f | xargs ls -l

this will give you the files and its permissions. There is an example below
-r--r--r-- 1 kguclu cvsgrp 2003-05-24 21:55 ./project/file1,v
-r--r--r-- 1 kguclu cvsgrp 2003-05-24 21:55 ./project/file2,v
-r--r--r-- 1 cvs cvsgrp 2003-05-24 20:59 ./project/file3,v
-r--r--r-- 1 cvs cvsgrp 2003-05-24 20:59 ./project/file4,v
-r--r--r-- 1 cvs cvsgrp 2003-05-24 21:33 ./project/file5,v
-r--r--r-- 1 cvs cvsgrp 2003-05-24 21:36 ./project/test/file1,v
-r--r--r-- 1 cvs cvsgrp 2003-05-24 21:36 ./project/test/file2,v
-r--r--r-- 1 cvs cvsgrp 2003-05-24 21:36 ./project/test/file3,v
-r--r--r-- 1 kguclu cvsgrp 2003-05-24 21:57 ./project/test1/file1,v

so if your stucture doesnot look like the same you should change them appropriately but
there are some files under CVSROOT directory which has different permissions for that reas
cvs guide "http://www.cvshome.org/docs/manual/cvs_2.html#SEC13"

1 sur 3 10/02/2011 13:06


Creating a cvs repository with pserver authentication http://www.korayguclu.de/index.php?&file=linux.cvs.pserver.xml

If your repository has different permissions use the following commands in order to set the
right permissions use
find . -type d | xargs chmod 775

to set the directory permissions and use


find . -type f | xargs chmod 444

to set the file permissions

Step 3.2
If you are starting up a new project simply use the following to create a new repository from
scratch.
cvs -d /usr/local/cvsroot init

Step 4
To inherit the parent directory permission to the newly created sub dirs use chmod g+s to set
the SGID bit of the directory. use the following command to set the SGUID bit of sub
directories
find . -type d | xargs chmod g+s

Step 5
Make sure /etc/services contains the line
cvspserver 2401/tcp

Step 6
Depending on your linux distribution you can may need to edit different configuration files.
If your system has /etc/inetd.conf edit that file add the following line (only one line) and
restart inetd by "killall -HUP inetd"
cvspserver stream tcp nowait root /usr/bin/cvs cvs
--allow-root=/usr/local/cvsroot pserver

if you donot have /etc/inetd.conf this means that your linux distribution uses xinet.d create
/etc/xinet.d/cvspserver file and Inside that file paste the following and restart your xinetd:
service cvspserver
{
disable = no
protocol = tcp
socket_type = stream
wait = no
user = root
server = /usr/bin/cvs
server_args = -f --allow-root=/usr/local/cvsroot pserver
passenv =
groups = yes
}

Step 7
If you skip or forget that step you get the following message
cvs server: failed to obtain dir lock in repository /usr/local/cvsroot

In order to fix this problem edit CVSROOT/config and add the following
LockDir=/var/lock/cvs

create a cvs lock directory and set the permission of the directory, allow write access to the
group members
mkdir /var/lock/cvs
chgrp -R cvsgrp /var/lock/cvs

2 sur 3 10/02/2011 13:06


Creating a cvs repository with pserver authentication http://www.korayguclu.de/index.php?&file=linux.cvs.pserver.xml

chmod -R g+w /var/lock/cvs

Step 8
To test, go to your home directory and enter:
cvs -d :pserver:cvs@tiger:/cvs login
cvs -d :pserver:cvs@tiger:/cvs co .

Copyright © 2002 by Koray Güclü.

3 sur 3 10/02/2011 13:06

Вам также может понравиться