Saturday, November 13, 2004

CVS Respitory on as400 Iseries II

Well got the samba mount to our development as400 working. I could see the as400 IFS from the linux samba mount.

So I setup a directory called repository,at /home/cvs.
Set the access level and access mode of directory /home/cvs/repository: chmod 770 /home/cvs/repository
Set setgid bit on directory /home/cvs/repository: chmod g+s /home/cvs/repository
(last two done via qshell)

Unfortunately the samba mount does not play very nicely with CVS. When i tried to initialise a new repository using the command:
cvs -d /mnt/cvs/repository init

I got an input/output error and the linux box lost the connection to the as400.

Thinking that there must be a way to get this working I did some reading and discovered (Columbus style, as I wasnt the first) NFS.

So I set up NFS on the 400, by first adding this to /etc/EXPORTS:
/home/cvs RW=198.26.21.122,root=198.26.21.122,anon=-1

then starting NFS:
STRNFSSVR SERVER(*ALL)

Then on the linux box, I setup the mount in /etc/fstab so it kicks in on reboot:
198.26.21.122:/home/cvs /mnt/cvs nfs rw

ok, fine and dandy, did reboot and did an ls in /mnt/cvs and hooray, as400 IFS.
Then to setup the cvs repository:

cvs -d /mnt/cvs/repository init

this also ran fine and dandy.

The next step on the linux box was to modify xinetd service to enable pserver protocol

Logged in as root.

Create a file named cvspserver in directory /etc/xinetd.d with this content:

# default:
off # description: An cvs server.
service cvspserver {
disable = no
socket_type = stream
protocol = tcp
user = root
wait = no
server = /usr/bin/cvs
server_args = -f --allow-root=/home/cvs/repository pserver
log_on_success +=USERID
log_on_failure += USERID
}

Open /etc/services and verify that these two lines are present. If they are not, add them:
cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations

Restart xinetd service:
service xinetd restart

did all that, then as instructed, setup the user environment

Open the file /etc/profile. You should to see these lines in the file:
USER='id -un'
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"

Add one line after the environment variable MAIL.
CVSROOT=":pserver:$USER@localhost:/home/cvs/repository"

In the file, you should also see a line like this:
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

Modify it and add CVSROOT into the export list like this:
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC CVSROOT

Test the installation by local users

Developer 1 log in as cvsdev1.
Make sure the environment variable is correct by typing this command:

echo $CVSROOT

It should return a result like this related to the user name:
:pserver:cvsdev1@localhost:/home/cvs/repository

I did get an error at this point related to dodgy characters in my etc/profile file. This was caused by downloading the file to windows, (i USE WinSCP), and editing using wordpad which introducing dos style line breaks. To fix this I opened the file in vi, and then did :set ff=unix to change the file format

logged off and tried echo $CVSROOT again, and got the correct result this time!

Then tried to login to cvs (had previously used useradd to create cvs, and 2 other users)
CVS login
was prompted for password but when i entered my linux login, got
cvs [login aborted]: connect to localhost(127.0.0.1):2401 failed: Connection refused

I think this is related to the cvs pserver setup. Ive tried a few things but havent got to the bottom of it on as400 yet.

No comments:

Post a Comment