Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Installing a CVS pserver UNIX
Hey! You just crave to install a CVS server on a MacOS X computer so several people can work on the same project or to have a single repository for your sources on your network? Don't worry, this is very simple, as long as you have installed the Developer Tools.

If you'd like to do get a CVS server running, read the rest of this article.

[Editor's note: I have not tried this myself, and there may very well be a typo or two I made in posting this article ... if something doesn't work, please let me know what needs to be fixed!]

First of all, create the directory that will act as the repository. This directory only needs to be readable/writable for the root user (that is for at least ONE user). For the rest of this article, I'll refer to this directory as %CVSROOT.

Then, you will need to actually create the repository. Type sudo cvs -d%CVSROOT init in your Terminal window. If you look in the newly created repository, you should have a folder named CVSROOT. It will contain all the options and informations about your CVS repository. Have a look at the 'options' ans 'passwd' files, these are the most important ones. For more information on how to configure the cvs server, point your browser to the Developer Tools' CVS documentation.

In these documentation files, you can find a lot more than what you will find here. This is only a walkthrough to get the server running as fast as possible, and a workaround for the instructions in these files, which are globally accurate, but not for the configuration of inetd.conf.

Next we will have to make sure the CVS repository is remotely accessible. Check the permissions on the /etc/inetd.conf file:
$ ls -l /etc/inetd.conf
-rw-r--r-- 1 root wheel 2654 Nov 5 00:28 /etc/inetd.conf
You must have a 'w' somewhere. Otherwise, you will not be able to save changes. Now, open the file using sudo (personally i like 'sudo open -e /etc/inetd.conf' [Editor: I'm not sure this works after the security update]). What a mess! A lot of lines, most of all commented. Go to the bottom of the file and add the line:
cvspserver stream tcp nowait root /usr/libexec/tcpd /usr/bin/cvs --allow-root=%CVSROOT pserver
That's where the trick is. In the docs they say that you should replace '/usr/libexec/tcpd /usr/bin/cvs' with '/usr/bin/cvs cvs'.

Now kill the 'inetd' process, and restart it ('sudo inetd'). There you are! You have a perfectly operationnal CVS pserver (clear text). Proceed accordingly if you want to add kerberos encryption and read carefully about ssh access to CVS.

Note that you will have to use the cvs commands with the correct -d flag. Let's look at a very brief test:
$ cvs -d :pserver:[your authorized user here]@[your ip there]:%CVSROOT login
(Logging in to [your authorized user here]@[your ip there])
CVS password:
$
We're in! Now you can import, checkout, commit, branch, whatever!
$ cvs -d :pserver:[your authorized user here]@[your ip there]:%CVSROOT logout
(Logging out of [your authorized user here]@[your ip there])

Have fun!

Krugazor
    •    
  • Currently 1.50 / 5
  You rated: 2 / 5 (2 votes cast)
 
[30,886 views]  

Installing a CVS pserver | 11 comments | Create New Account
Click here to return to the 'Installing a CVS pserver' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
pserver passwd
Authored by: reverie on Nov 07, '01 02:12:45PM

This is excellent--I tried and failed to install a pserver about 6 months ago, after having successfully set one up on a linux box. I'll have to give this a try...

One thing that you'll run into first thing after the pserver is set up is that there's no tool to create or change passwords for it. Fortunately, Mac OS X comes with htpasswd, a utility for creating passwords for websites. It just happens to use the same encryption method as the unix system's and the pservers passwd files. Just type:

htpasswd -c passwd foo

where passwd is the name of your password file and foo is the username, and it will create the file and prompt you for the password. If the file already exists, leave out the -c switch. Open up the file with the text editor, and you'll see:

foo:<gibberish>

The gibberish is the encrypted password--you can edit the username before it and add options after it as per the instructions on the web page, as long as you don't edit the string itself.

Oh yeah, and if you write any code that uses more than 2 or 3 files, USE CVS! And if you test/operate/develop the code on more than one system, SET UP A CVS SERVER! It only takes about 5 minutes to learn, and you'll thank yourself later.



[ Reply to This | # ]
pserver passwd
Authored by: PeterNSteinmetz on Sep 09, '02 10:51:41AM

Following up on Bill Rising's comment about the need to also add /services/cvspserver to the NetInfo database

After the above is performed, under 10.1.5, it consistently complains that there is an authentication failure after the connection is made to 2401.

This occurs whether one is using a user name in CVSROOT/passwd or another valid username in the NetInfo database or a valid username in /etc/passwd. It also occurs when all of the above are true for the same username and the CVSROOT/passwd system users name is the same.

Under Server 10.1.4, the pserver will work with users in the NetInfo database and with entries in the CVSROOT/passwd file.

cvs --version under both OS X versions is the same, namely 1.10.

It appears that some change to the authentication system between 10.1.4 and 10.1.5 must have broken the pserver in cvs.

Any one else with suggestions on fixing?

cheers,
Peter



[ Reply to This | # ]
Don't forget to change the NetInfo-Database
Authored by: mguske on Dec 11, '01 10:14:20AM

Hi,

i did everything you described here, but I wasn't able to connect to the pserver via port 2401 (which is the standard port -> /etc/services is the resource for this)

I works after I added the port "2401" with name "cvspserver" inside the services section of NetInfoManager.

Maybe anybody else has the same problem to get the pserver up and running.

Regards,

Markus



[ Reply to This | # ]
Don't forget to change the NetInfo-Database
Authored by: jarrettwold on Dec 12, '01 02:10:16AM

You know, had I known that a few days ago. I would have been a much happier person :) This is where I found mine, shortly before finding yours http://www.macsecurity.org/mail/macosx-admin/apr99/msg00247.shtml



[ Reply to This | # ]
Don't forget to change the NetInfo-Database
Authored by: brising on Aug 05, '02 02:38:24PM

I tried a cross between the instructions here, and the instructions at

http://www.geektimes.com/macintosh/os/x/and/cvs_install.html

but still keep getting "server localhost rejected access" errors. This happens when using either a blank passwd file or when using a passwd file created using htaccess. Could anyone give a hint as to what it is I'm doing wrong?

Bill



[ Reply to This | # ]
A bit confused
Authored by: mouser on Feb 26, '02 10:15:08PM
I got the installation to work. So, info was mostly fine doing this on Mac OS X 10.1.3, except for the
sudo open -e /etc/inetd.conf

thing, where I simply resorted to use vi (gasp!).

I've also made myself a couple of shell scripts to wrap the cvs login and logout; aka

#/usr/bin/sh
setenv CVSROOT "/Volumes/Engineering/myRep"
cvs -d :pserver:mouser@127.0.0.1:%CVSROOT login

and a similar one for logout. Now, I'm just wondering. I can't work the files directly from there can I?

When using mac CVS Pro, for example, off a remote repository, you end up having a local copy of the sources. Must I, using this local setup, have another copy of the sources for my work tree?

I just couldn't cvs add anything in the myRep directory, with CVS complaining there were no versions there and I needed to do a checkout first.

Anyone can point me in the right direction here?

[ Reply to This | # ]
Instructions for 10.2
Authored by: kwiersma on Sep 17, '02 02:13:07PM

Setup for cvspserver is even easiler in OS 10.2. Here is what I did.

1. Create a new file cvspserver in /ete/xinetd.d/
2. Inside that file paste:

service cvspserver
{
disable = no
protocol = tcp
socket_type = stream
wait = no
user = root
server = /usr/bin/cvs
server_args = -f --allow-root="Your CVSROOT here" pserver
passenv =
groups = yes
}

3. Replace "Your CVSROOT here" with the location of your repository (example: /usr/local/cvsroot).

4. Restart xinetd. Send a SIGHUP signal to the xinetd process.

5. Change your firewall configuration to allow port 2401 if appropriate.

Now you are done and should be able to connect.

--Kurt



[ Reply to This | # ]
MacCVS Pro -> OS X Server
Authored by: jpipitone on Sep 17, '02 02:39:04PM

OK - I followed the directions to set up a CVS server on my Mac OS X Server 10.1.4. Only thing is, when I try to connect with MacCVS Pro 2.7d3, It says "the checkout could not be completed because authentication failed. Either your username, password, or remot repository path is incorrect."


Any ideas?

Thanks

-Joe Pipitone
joe@spdesign.net



[ Reply to This | # ]
MacCVS Pro -> OS X Server
Authored by: jpipitone on Oct 08, '02 11:57:36AM

I think I've set up CVS on my 10.2 Jaguar server..... Can someone supply me with instructions on how to use MacCVS Pro on an OS 9 environment? I want users to be able to check out a file, edit it, and check it back in with an update.

10.2 doesn't seem to let me authenticate....what am I doing wrong?

Joe Pipitone
joe@spdesign.net



[ Reply to This | # ]
"failed to open .cvspass for reading" error
Authored by: NateMac on Jul 10, '03 11:36:30AM

If you are able to connect to the CVS pserver but unable to log in, there could be a bug in CVS.

This is the error I was getting:
-----------------
[Zen-Master:~] ngb% cvs -d :pserver:ngb@localhost:/cvs
login

Logging in to :pserver:ngb@localhost:2401/cvs

CVS password:

cvs login: warning: failed to open /Users/ngb/.cvspass for reading: No such file or directory
-----------------

This would happen no matter if I tried logging in via MacCVS client or the command line.

I found the answer here:
http://mail.gnu.org/archive/html/info-cvs/2003-03/msg00313.html
The key is to remove the space between "-d :pserver:...". For me,
-----------------
[Zen-Master:~] ngb% cvs -d:pserver:ngb@localhost:/cvs login

Logging in to :pserver:ngb@localhost:2401/cvs

CVS password:

[Zen-Master:~] ngb%
-----------------
works just fine!

After I log in, the .cvspass file is created in my home directory, and I can use the GUI client or the command line without a problem.

Hope this helps people!

By the way, in case anyone is interested, I'm running CVS version 1.11.6 (downloaded and installed from http://www.cvshome.org ) on OS X v10.2.6.

-NateMac



[ Reply to This | # ]
CVS pserver on panther 10.3
Authored by: dustox on Dec 02, '03 09:41:25PM
Using info from this hint and other places I was able to get a cvs server set up properly on my OS X 10.3 box. I posted all the steps I went through at http://sillytech.com/thread.php?thread_id=440

[ Reply to This | # ]