Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!mcvax!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: comp.unix.questions Subject: Re: vipw - the program Message-ID: <63@titania.warwick.ac.uk> Date: 22 Oct 88 10:55:18 GMT Article-I.D.: titania.63 References: <218@fantasci.UUCP> <14043@mimsy.UUCP> Reply-To: cudcv@warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 24 In article <14043@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >In article <218@fantasci.UUCP> jep@fantasci.UUCP (Joseph E Poplawski) writes: >>if [ -f "/etc/ptmp" ]; then exit 1; else cat /dev/null >/etc/ptmp ... > >This has a window during which it will not notice the lock file. >You are much better off using links, viz.: >... > if ln $tf $lock 2>/dev/null; then exit 1; else ... Except that this seems to be silently broken under (at least some versions of) System V, in which ln(1) deletes the file first, and the command succeeds. See: Newsgroups: news.software.b,comp.sources.bugs Subject: C News Bulletin #8 - fixes for illegal message-IDs, System V ln(1) Message-ID: <1988Oct18.064611.25833@utstat.uucp> `mkdir $lock' should still work though ... Rob -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England