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