user2132980
user2132980

Reputation: 225

cvs no longer works on mac os x sierra from remote terminal

After updating to mac os x sierra my cvs (yes I am still using cvs) repository is no longer accessible from remote computer. I can still access the cvs commands on local machine using terminal window, using:

CVSROOT=/usr/local/cvsrep

although if I define the cvs variables with

export CVS_RSH=ssh
export CVSROOT=:ext:[email protected]/usr/local/cvsrep

it also does not work, giving error message:

tw-imac:testcvs twarren$ cvs version
Client: Concurrent Versions System (CVS) 1.12.13 (client/server)
Password:
bash: cvs: command not found

The cvs program is installed in /usr/local/bin (which is on the PATH). It is the old version of cvs that used to come with mac os x and has worked fine with newer versions of mac os x until sierra.

Upvotes: 3

Views: 1740

Answers (2)

stux
stux

Reputation: 2976

I've just faced this same issue.

ie, remote cvs checkouts don't work.

ie, cvs -z3 -d:ext:<user>@<cvs-server-ip>:<CVSROOT> co -P -r <REVISION> <MODULE> results in cvs: bad command

There are three problems,

  1. cvs was removed back in 10.9
  2. cvs over ssh relies on the sshd PATH support, which is hard-coded
  3. /usr/bin is rootless, ie read-only.

You solve the first problem by installing cvs with homebrew

The next problem, is that when you try to run cvs:ext, you find the PATH is not right, this can be tested like so:

ssh <user>@cvs-sever-ip env | grep PATH

You will see, PATH=/usr/bin:/bin:/usr/sbin:/sbin, which is the sshd non-interactive hard-coded path. For non-interactive ssh, as used by CVS to access the homebrew cvs install (installed into `/usr/local/bin/cvs) you need to add /usr/local/bin to the sshd path. AFAICT this can't be done... non-trivially... as such, the best solution is to make a sybolic link in the /usr/bin directory.

sudo ln -s /usr/local/bin/cvs /usr/bin/cvs

Which leads to the third problem. It doesn't work, because /usr/bin is rootless... and thus read-only.

You could disable rootless mode in recovery mode... and then do it, and then re-enable it.

But the simplest solution is to reboot into Recovery mode, enter the terminal, then cd /Volumes, then navigate to the the /usr/bin directory on your boot volume, ie cd /Volumes/<bootvolume>/usr/bin

then run the command:

ln -s /usr/local/bin/cvs cvs

This will create a symbolic link from /usr/bin/cvs -> /usr/local/bin/cvs

Reboot back to your OS, and that should fix it.

You can verify this with

ssh <user>@<cvs-server-ip> which cvs

which should return :

/usr/bin/cvs

And now your remote cvs checkouts should work...

Upvotes: 3

user2132980
user2132980

Reputation: 225

so I found a way to get cvs to work on sierra. The problem seemed to be that the /usr/local/bin directory was no longer on the path of the shell started by ssh. So the solution consisted of copying the cvs executable to /usr/bin

However, in order to accomplish this on Sierra I had to temporarily disable SIP. This was done by:

  1. reboot with recovery mode
  2. run terminal utility
  3. execute: csrutil disable
  4. reboot

Then I could copy the cvs program. After verifying that it worked properly, I repeated the steps 1-4, except using: csrutil enable in step 3.

NOTE: there will probably be cases where updates to Sierra might replace /usr/bin contents, so it's possible that this process will need to be repeated after updates. To aid in this, I copied the cvs module rather than moving it, so it will still be available in its old location.

NOTE 2: I agree with those who recommend using git rather than cvs and will do that with all new projects. In addition I will eventually also convert existing projects to git where feasible, but am glad that I can still use cvs as before Sierra.

Upvotes: 2

Related Questions