SCCS and RCS over NFS (was: Creating a lock file in sh?)

Leslie Mikesell les at chinet.chi.il.us
Tue Apr 23 03:56:20 AEST 1991


In article <28124072.1774 at tct.com> chip at tct.com (Chip Salzenberg) writes:
>>For example (Bourne shell):
>>
>>	if (umask 777;  echo >lock)
>>	then
>>		Perform whatever operation required locking.
>>		rm -f lock
>>	else
>>		Report that you could not obtain the lock.
>>	fi
>
>Unfortunately, this method is still prone to spurious failure when an
>imperfect network loses the ACK from the initial creation attempt.

Spurious failure is not nearly as bad a problem as spurious success
when creating a lockfile.  However, won't this always break when
run by root?

Les Mikesell
  les at chinet.chi.il.us



More information about the Comp.unix.shell mailing list