home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 10820 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  2.3 KB

  1. Xref: sparky comp.unix.questions:10820 comp.sys.sgi:13372 comp.unix.misc:3581
  2. Newsgroups: comp.unix.questions,comp.sys.sgi,comp.unix.misc
  3. Path: sparky!uunet!wupost!micro-heart-of-gold.mit.edu!xn.ll.mit.edu!ll.mit.edu!lebrun
  4. From: lebrun@ll.mit.edu (Steven F. LeBrun)
  5. Subject: File Locking across NFS mounts
  6. Message-ID: <9209080829.PN04389@LL.MIT.EDU>
  7. Sender: news@ll.mit.edu
  8. Organization: MIT Lincoln Laboratory, Lexington, MA
  9. Distribution: comp
  10. Date: Tue,  8 Sep 92 08:29:47 -0400
  11. Expires: 25 Sept 1992
  12. Lines: 33
  13.  
  14.  
  15. I am looking for a method of file locking what works across NFS
  16. mounted directories and am interested on what methods other 
  17. people are using.
  18.  
  19. I tried flock() and discovered a bug that only exists if the file 
  20. being locked is a remote (NFS) file.  If a program terminates without 
  21. unlocking an NFS file (due to a system reboot, user abort, program 
  22. bug [this is how I discovered the problem -- bugs can be useful at 
  23. times :-) etc.] the file remains locked so that no other programs 
  24. can access the file.
  25.  
  26. The programs that access the file are running on different computers 
  27. with the same file accessible via NFS mounts.  Currently, the programs 
  28. are all running on SGI Indigo's (IRIX 4.0.1) and other computers of 
  29. unknown type will be added later.  I would prefer staying with advisory 
  30. file locking but manditory file locking is an option.  Since the file
  31. being locked is a log/audit trail file that the programs append their
  32. next entries, locking the entire file is acceptable.  Locking the next
  33. local record (next entry) and the entire file will have the same 
  34. effect on the programs accessing the file.
  35.  
  36. --
  37.  
  38. +--------------------------------------------------------------------------+
  39. | Steven F. LeBrun             |      MIT Lincoln Laboratory, Group 91     |
  40. |                              |        244 Wood Street, Room LI-136       |
  41. | lebrun@ll.mit.edu (Internet) |          Lexington, MA 02173-9108         |
  42. | lebruns@merlin    (internal) |  Phone:(617)-981-5742, FAX:(617)-981-0991 |
  43. +--------------------------------------------------------------------------+
  44. |"Hard as ligthning, soft as candlelight;                                  |
  45. |                    Dare you trust the Music of the Night?" - The Phantom |
  46. +--------------------------------------------------------------------------+
  47.