LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-07-2008, 08:40 PM   #1
dgermann
Member
 
Registered: Aug 2004
Distribution: Ubuntu 16.04 lts desk; Ubuntu 14.04 server
Posts: 366

Rep: Reputation: 31
Question What affects file locking?


Hi--

We are in a production environment with one WinXP box and several linux boxes.

We have discovered that the WinXP and linux boxes seem to respect each other's file locks, but that the linux boxes do not respect each other's locks. In other words, box 1 can have a file open, and at the same time box 2 can open it and edit and save the file.

We have smb.conf set with level2 oplocks yes, kernel oplocks no, and oplocks no. When we first noticed the problem the last two were set to yes. The change has made the locks work sometimes, but not reliably.

Are there other things besides the oplocks and the smb.conf file which can affect file locking? How would you trouble shoot this?

Thanks!
 
Old 08-08-2008, 12:42 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Unix file system locks are specified by the program itself; if the program does not create or open a file with strict access, other processes can open the file as well.

Another form of locking is cooperative, but this requires all programs to cooperate in the locking protocol.
 
Old 08-08-2008, 08:38 AM   #3
dgermann
Member
 
Registered: Aug 2004
Distribution: Ubuntu 16.04 lts desk; Ubuntu 14.04 server
Posts: 366

Original Poster
Rep: Reputation: 31
Question

Mr. C.--

Thanks for your help.

So are you saying that I need to look into OpenOffice.org for the locking? That might actually explain why some versions of OOo can open a file while others have it open, and other versions cannot....

Thanks!
 
Old 08-08-2008, 11:25 AM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
I don't know what protocols OOo supports, but I can imagine it has an open-for-write exclusive lock feature.

The key point to remember, programs must be written to support locking. Such a program in Unix/Linux is vipw which opens the /etc/passwd file exclusively, where as standard vi/vim would not. Likewise for visudo to the /etc/sudoers file. It is a long established tradition to use these utilities when there are multiple sys-admins who could be opening the same file at the same time.
 
  


Reply

Tags
file, locking



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bugs in file locking? jaristr Linux - Kernel 1 02-25-2007 10:17 AM
how can I see what programs are locking a certain file ? Menestrel Linux - Newbie 4 07-27-2004 04:25 PM
locking a usage policy file/ftp file permissions gbow Linux - Newbie 0 02-16-2004 05:35 AM
File locking in Linux xailer Programming 5 12-29-2003 02:00 PM
python; file locking TheLinuxDuck Programming 22 08-05-2003 05:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration