Thursday 25 February 2010

Configuring CVS pserver on opensuse or SLE.

I am posting the how to configure the pserver for opensuse or SLE *nix installations so I can find it again with out trawling through many different sites that have very general information about this but also hopefully help someone else with the same problem.

1. Install CVS using yast.

2. Open up a terminal and login as root.

3. vi /etc/xinet.d/cvs

4. Change disable = yes to no

5. Make sure the 'server_args' attribute is pointing to your cvs repository i.e 'server_args = -f --allow-root=/usr/local/cvsroot pserver'

Now start/restart the xinet.d with either rcxinet start / rcxinet restart.

This will now enable your pserver to work and you can see it running by looking at your /var/log/message you should see something like

Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/chargen [file=/etc/xinetd.conf] [line=26]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/chargen-udp [file=/etc/xinetd.d/chargen-udp] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/cups-lpd [file=/etc/xinetd.d/cups-lpd] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/cvs [file=/etc/xinetd.d/cvs] [line=11]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=16]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/daytime-udp [file=/etc/xinetd.d/daytime-udp] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/discard [file=/etc/xinetd.d/discard] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/discard-udp [file=/etc/xinetd.d/discard-udp] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/echo [file=/etc/xinetd.d/echo] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/echo-udp [file=/etc/xinetd.d/echo-udp] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/netstat [file=/etc/xinetd.d/netstat] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/rsync [file=/etc/xinetd.d/rsync] [line=16]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/sane-port [file=/etc/xinetd.d/sane-port] [line=12]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/servers [file=/etc/xinetd.d/servers] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/services [file=/etc/xinetd.d/services] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/systat [file=/etc/xinetd.d/systat] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=17]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/time-udp [file=/etc/xinetd.d/time-udp] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/vnc [file=/etc/xinetd.d/vnc] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Mar 1 17:43:18 022656 xinetd[24151]: Started working: 1 available service

Next to consider is authentication. There are two options for this and that is either system authentication and that will be users on the box you are using or cvs's own passwd file authentication.

If you would like to use the system authentication then just add systemAuth = yes into your /etc/xinet.d/cvs file as we did above and login to the cvs server using cvs -d :pserver:username@host:/cvsroot login.

If you would like to use the passwd option then we need to make sure some requirements are availible.

1. Perl is installed on your system if not install it with yast
2. A user that has access to manipulate the cvs repository (from here on will be called cvs)
3. Logged in as root

Next navigation to your CVSROOT and create a new file named passwd and crypt.pl with 'touch' command.

Next make sure you have perl installed on your system and copy the crypt.pl code from this site (thank you Marty Phelan.) and store in your crypt.pl file. Make the file executeable with 'chmod +x crypt.pl'.

Next run the crypt.pl file with 'perl crypt.pl ' change to the password you want. This will encrypt your password to be used with in passwd file.

Copy the out put of the encryption and open the passwd file i.e vi passwd.

In the passwd file you determain the username password and the user that can access and alter cvs repository i.e
einarhreindal:asd032kasdf2:cvs this translates into username:password:user that can acces and alter cvs repository.

Save the file and check you can login to the pserver with cvs -d :pserver:username@host:/cvsroot login if you have any problems with login in then check the /var/log/message for any debug info.

Great site on how to create a repository can be found here.