Path: utzoo!utgpu!cunews!cognos!geovision!barry From: barry@geovision.gvc.com (Barry Comer) Newsgroups: comp.unix.wizards Subject: lockf over the network Message-ID: <1661@geovision.gvc.com> Date: 26 Jun 91 19:02:52 GMT Reply-To: barry@geovision.gvc.com () Distribution: na Organization: GeoVision Corp, Ottawa, Canada Lines: 41 I am trying to find a way to unlock files on a server that have been locked using lockf. It goes something like this: -machine "A" is a server. -machine "B" and "C" are workstations with their own disk systems. -a file system located on machine "A" is NFS mounted on "B" and "C" -machine "B" places a advisory lock on file "X" using the F_TLOCK option. -machine "B" crashes (I.E. power outage, L1-A, etc) leaving the lock on file "X". -when machine "C" tries to lockf file "X" it fails. What can be done to unlock file "X" on the server(short of rebooting the server)? I have tried using the following: #include #include #include #include #include FILE *fopen(), *fd1; int rc; void main() { fd1 = fopen("X", "w"); rc = lockf(fileno(fd1), F_ULOCK, 0); fclose(fd1); } But all this should do is remove any lock that was put on during the runtime of some program that this fragment might belong to. It would seem to me that this could be a common type of problem, any ideas. thanks in advance Barry Comer P.S. Rebooting the server is not an option.