For those of us still using CVS, rather than the highly acclaimed subversion, I wanted to outline a solution to a common problem I’ve often seen:
One user creates a cvs module (named, for example, project) and checks in a number of files and directories. Then another developer tries to check out the module and sees this error. (Here’s another explanation of the solution.)
: cvs checkout: failed to create lock directory for
`/usr/local/cvsrepo/project'
(/usr/local/cvsrepo/project/#cvs.lock): Permission denied
: cvs checkout: failed to obtain dir lock in repository
`/usr/local/cvsrepo/project'
: cvs [checkout aborted]: read lock failed - giving up
If you go to /usr/local/cvsrepo/project
, and run an ls -l
, you’ll see that the permissions look like:
...
drwxrwxr-x 2 user group 4096 Feb 16 09:40 bin
...
This error message comes from the fact that the second user is not a member of group group
. The best way to solve this is to create a second group, perhaps called cvs
, and assign both users to that group.
Then, you want to make sure that all the files have the correct group bit set:
chown -R :cvs /usr/local/cvsrepo/project
And, you want to make sure that any new directories (and files) added use the cvs
group, rather than the group
group:
chmod -R g+ws /usr/local/cvsrepo/project
Your final permissions should look like:
...
drwxrwsr-x 2 user cvs 4096 Feb 16 09:40 bin
...
Now the second user and any other developers should be able to check out the code so safely stored in cvs.
Exactly what I have the problem after read CVS for Leopard .
Thanks
Hats Off Great work!
Timely Help..
you saved my life man…!
hats off
thanks for the post man.
All,
Glad to help!
This just helped me out too on my Leopard-based CVS server! Thanks!
Excellent post. Thanks.
Thank you !
This post helped me a lot.
Thanks. This was a great help.
Keep up the good work.
Good timely help while implementing cvs. Thank you.
Perfect, thanks a bunch!
Geat………Great Help Man
Nice post!
Exactly what I needed.
Thanks a lot
Great, thanks!!!
Very thankful to you,
It just worked swiftly.
I too faced the same problem, but in my case two groups just need to check out each others directory. So its simple just give permissions such as 775 to the directories.
But yet the problem wasn’t solved.
The reason was /var/lock/cvs/ need to have write permission to the user who does check out this directory.
The problem solved.
Freshbee,
Awesome! Thanks for sharing your fix. I’ve never run into the situation where I needed two groups to be able to check out one source tree.
So, am I correct in assuming you chmoded /var/lock/cvs to 777? That seems to be the only way to have two different groups have write permissions on one directory.
Thanks for the tip – exactly what I was looking for!
Thanks, you saved my life!
thanks. nice post…
Very Helpful Post. Tnx!
I too faced the same problem, but in my case two groups just need to check out each others directory. So its simple just give permissions such as 775 to the directories.
But yet the problem wasn’t solved.
The reason was /var/lock/cvs/ need to have write permission to the user who does check out this directory.
The problem solved.
—–
if still the problem persists kindly check the file /CVSROOT/config,
there u need to enable this field.
# Put CVS lock files in this directory rather than directly in the repository.
LockDir=/var/lock/cvs
this says that the lock will not be created in the repository, but in the lock directory, where the user will have write provision.
Hi all,
I had this problem when working with cvs files on UNIX, that has someone else checkouted with WinCVS with windows CRLF.
I had to change all those Repository files and it worked 🙂
for i in `grep -r -Pl $’rn’ . | grep Repository`; do dos2unix -o $i; done
Pucik
In my case the problem was that a colleague had removed the specified directory from the repository (CVS doesn’t support this, but they went ahead and did it manually).
One more solution is that the cvs passwd file should have a system user on the CVS server. Then add all the developers name/password combination in to the cvs passwd file with the system user appended to each users name/password.
This link explains that: http://www.network-theory.co.uk/docs/cvsmanual/Passwordauthenticationserver.html
Thanks man, this helped a lot to solve the problem!
cvs checkout: failed to create lock directory for `/cvs/dev/CVSROOT’ (/cvs/dev/CVSROOT/#cvs.history.lock): Permission denied
The above mentioned is my error,so i have checked ls -l in this path /cvs/dev/CVSROOT/ but i am not getting any file “bin” in this list.Where to check the correct permissions guys….Kindly help as soon as possible.
Can you show us the output of the “ls-l /cvs/dev/CVSROOT” command, as well as your username and group?
It has too much of files which set of files do you need to check .i will screen it
Whichever file you are trying to check in would be the best place to start.