Thursday, 13 August 2009

CVS in iSeries PASE

I've been playing at getting CVS running in iSeries (i5/AS400) PASE...

The steps that I have followed so far have been:

1. Downloaded AIX CVS binary from http://ftp.gnu.org/non-gnu/cvs/binary/feature/powerpc-aix/cvs-1.12.13-AIX.bin.gz

2. Unzipped binary into /usr/local/cvs

3. Created a symbolic link to the binary in /QOpenSys/usr/bin :-
ln -s /usr/local/cvs/cvs-1.12.13-AIX cvs

4. Created a 'cvs' user profile - a basic *USER class user profile (I actually copied it from the PHP "nobody" user profile and set the home directory to /home/cvs)

5. Added an entry to /QIBM/UserData/OS400/INETD/inetd.conf
pserver stream tcp nowait cvs /QSYS.LIB/QP2SHELL.PGM QP2SHELL /QOpenSys/usr/bin/cvs cvs -f --allow-root=/cvsroot pserver

6. Add the service entry
ADDSRVTBLE SERVICE(pserver) PORT(2401) PROTOCOL(tcp)

7. Initialise the CVS repository
cvs -d /cvsroot init

8. Start INETD
STRTCPSVR *INETD

When I try and test this locally, things seem to be OK.

In a PASE terminal (CALL QP2TERM) I can create and import a test file:-

export CVSROOT=/cvsroot
mkdir /test
echo "I am a test" > /test/test.text
cd /test
cvs import -m "Test Import" Version-1 Revision-1

With the response :-

N test/test.txt

No conflicts created by this import

So, CVS is installed and running from that point of view..

However trying to access the service remotely (or via loopback to localhost) has thrown up a bit of a problem. When I try and log in to the cvs service as follows:-

cvs -d :pserver:user@server:/cvsroot login
CVS Password:

cvs [login aborted]: end of file from server (consult above messages if any)

If I try and telnet into port 2401 I get gobbledigook :-

õòÆòûªò@âûööüòäz@yâÑó}%%├ÕÔ@âûööüòäó@üÖàz%@@@@@@@@üää@@@@@@@@@@┴ää@ü@òàª@åëôàaäë
@úû@úêà@ÖàùûóëúûÖ¿%@@@@@@@@üäöëò@@@@@@@@┴äöëòëóúÖüúëûò@åÖûòú@àòä@åûÖ@Öâó%@@@@@@@
@üòòûúüúà@@@@@Ôêûª@ôüóú@ÖàÑëóëûò@ªêàÖà@àüâê@ôëòà@ªüó@öûäëåëàä%@@@@@@@@âêàâÆûñú@@
@@@├êàâÆûñú@óûñÖâàó@åûÖ@àäëúëòç%@@@@@@@@âûööëú@@@@@@@├êàâÆ@åëôàó@ëòúû@úêà@Öàùûóë
%@@@@@@@@äëåå@@@@@@@@@Ôêûª@äëååàÖàòâàó@éàúªààò@ÖàÑëóëûòó%@@@@@@@@àäëú@@@@@@@@@Ãà
@Öàüä¿@úû@àäëú@ü@ªüúâêàä@åëôà%@@@@@@@@àäëúûÖó@@@@@@Ôàà@ªêû@ëó@àäëúëòç@ü@ªüúâêàä@
%@@@@@@@@àºùûÖú@@@@@@@┼ºùûÖú@óûñÖâàó@åÖûö@├ÕÔk@óëöëôüÖ@úû@âêàâÆûñú%@@@@@@@@êëóúû
@@@@@@Ôêûª@ÖàùûóëúûÖ¿@üââàóó@êëóúûÖ¿%@@@@@@@@ëöùûÖú@@@@@@@╔öùûÖú@óûñÖâàó@ëòúû@├Õ
k@ñóëòç@ÑàòäûÖ@éÖüòâêàó%@@@@@@@@ëòëú@@@@@@@@@├Öàüúà@ü@├ÕÔ@ÖàùûóëúûÖ¿@ëå@ëú@äûàóò
}ú@àºëóú%@@@@@@@@ôûç@@@@@@@@@@ÎÖëòú@ûñú@êëóúûÖ¿@ëòåûÖöüúëûò@åûÖ@åëôàó%@@@@@@@@ôû
@@@@@@@@ÎÖûöùú@åûÖ@ùüóóªûÖä@åûÖ@üñúêàòúëâüúëòç@óàÖÑàÖ%@@@@@@@@ôûçûñú@@@@@@@┘àöûÑ
@àòúÖ¿@ëò@KâÑóùüóó@åûÖ@Öàöûúà@ÖàùûóëúûÖ¿%@@@@@@@@ôó@@@@@@@@@@@Ëëóú@åëôàó@üÑüëôüé
@åÖûö@├ÕÔ%@@@@@@@@ùóàÖÑàÖ@@@@@@ÎüóóªûÖä@óàÖÑàÖ@öûäà%@@@@@@@@Öüòòûúüúà@@@@Ôêûª@ôü
@ÖàÑëóëûò@ªêàÖà@àüâê@ôëòà@ûå@öûäñôà@ªüó@öûäëåëàä%@@@@@@@@Öäëåå@@@@@@@@├Öàüúà@}ùü
}@åûÖöüú@äëååó@éàúªààò@Öàôàüóàó%@@@@@@@@Öàôàüóà@@@@@@╔òäëâüúà@úêüú@ü@Èûäñôà@ëó@ò
@ôûòçàÖ@ëò@ñóà%@@@@@@@@ÖàöûÑà@@@@@@@┘àöûÑà@üò@àòúÖ¿@åÖûö@úêà@ÖàùûóëúûÖ¿%@@@@@@@@
@@@@@@@@@ÎÖëòú@ûñú@êëóúûÖ¿@ëòåûÖöüúëûò@åûÖ@ü@öûäñôà%@@@@@@@@Öôó@@@@@@@@@@Ëëóú@åë
@ëò@ü@öûäñôà%@@@@@@@@Öúüç@@@@@@@@@┴ää@ü@ó¿öéûôëâ@úüç@úû@ü@öûäñôà%@@@@@@@@óàÖÑàÖ@
@@@@@@ÔàÖÑàÖ@öûäà%@@@@@@@@óúüúñó@@@@@@@─ëóùôü¿@óúüúñó@ëòåûÖöüúëûò@ûò@âêàâÆàä@ûñú
@åëôàó%@@@@@@@@úüç@@@@@@@@@@┴ää@ü@ó¿öéûôëâ@úüç@úû@âêàâÆàä@ûñú@ÑàÖóëûò@ûå@åëôàó%@
@@@@@@@ñòàäëú@@@@@@@õòäû@üò@àäëú@âûööüòä%@@@@@@@@ñùäüúà@@@@@@@┬Öëòç@ªûÖÆ@úÖàà@ëò
@ó¿òâ@ªëúê@ÖàùûóëúûÖ¿%@@@@@@@@ÑàÖóëûò@@@@@@Ôêûª@âñÖÖàòú@├ÕÔ@ÑàÖóëûòMó]%@@@@@@@@ª
@@@@@@@@Ôàú@ªüúâêàó%@@@@@@@@ªüúâêàÖó@@@@@Ôàà@ªêû@ëó@ªüúâêëòç@ü@åëôà%MÔùàâëå¿@úêà
@``êàôù@ûùúëûò@åûÖ@ü@ôëóú@ûå@ûúêàÖ@êàôù@ûùúëûòó]%

Connection to host lost.

This looks like your typical ASCII/EBCDIC translation type stuff - but PASE is an ASCII environment and I am using INETD to connect straight through to the QP2SHELL program which gives me access to PASE for CVS. A little confusing and I'm not sure where to go next with this.. I'm wondering if the QTOGINTD program is getting in the way..

You also similar output (but not identical) when you try and telnet from within i5/OS to port 2401 on localhost.

I think I'll see if there's a way to get this running as a pserver without using inetd...