Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 6 windows computers (xp,vista,7) that need to access a samba share (Ubuntu 12.04). I am trying to make it so only one client can open a file at a given time. I thought this was pretty standard behavior of file locks, but I can't get it to work.

The way it is right now a file can be open by two users, and changed and saved by either one of them. The last file saved overwrites what ever changes the other user made. At first I thought this was a Samba configuration problem, but I get this behavior even between two windows machines. So far I have only tested:

  • Windows Xp >>> Windows Vista

  • Windows XP >> Samba << Windows Vista

and both give the same behavior.

When I tested the Samba configuration, I had set strict locking = yes and get errors logged like this:

close_remove_share_mode: Could not get share mode lock for file _prod/part_number_list_COPY.xlsx

Eventually all of the files are going to be moved onto the Samba share, so that is the configuration I am most concerned about fixing. Any ideas? Thanks in advance.

EDIT:

I tested an excel file again, and it is now working properly in both above mentioned cases, I am also no longer getting the above mentioned error. I don't know what happened, perhaps a restart fixed it? (also works with strict locking = no)

Although I still need to find a solution for the CAD/CAM files we use, the software is Vector and it does not seem to be using file locks.

Is there any software that I can use to manage these files, so two people can't open/edit them at a time? Maybe a windows application that forces file locks? Or a dirt simple version control system? (the only ones I have seen at are too complicated for our needs).

share|improve this question
    
What application are you using to open the files? If the application doesn't actually hold the file open (some do, some don't) then file locking is irrelevant. –  Harry Johnston Jun 17 '12 at 1:15
    
Ah, I was wondering if that was the case...at this point I have only tested Excel and Vector (CAD/CAM software). What is a common program that holds file locks, that I can use to test? Also do you know an alternate solution if a program does not hold file locks and I want this behavior? Thanks –  jpetersen Jun 17 '12 at 4:36
    
Excel usually holds the file open, so I guess that's not your problem. I've just checked, and if I try to open an Excel file from two computers at once I get a warning message on the second one and can only open it in read-only mode. –  Harry Johnston Jun 19 '12 at 1:03
    
Locking files over the network is unreliable at the best of times! –  Matt Jun 19 '12 at 1:53
    
Consider using some kind of DVCS maybe? –  Zoredache Aug 30 '12 at 2:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.