From owner-freebsd-questions Sat Apr 25 12:13:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA01351 for freebsd-questions-outgoing; Sat, 25 Apr 1998 12:13:27 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from kstreet.interlog.com (kstreet.interlog.com [198.53.146.171]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA01159 for ; Sat, 25 Apr 1998 12:13:12 -0700 (PDT) (envelope-from kws@kstreet.interlog.com) Received: (from kws@localhost) by kstreet.interlog.com (8.8.8/8.8.8) id PAA28539; Sat, 25 Apr 1998 15:12:33 -0400 (EDT) (envelope-from kws) To: Karl Pielorz Cc: questions@FreeBSD.ORG Subject: Re: Protecting Shell scripts from deadlocks... References: <35422E96.AFE7E766@tdx.co.uk> From: Kevin Street Date: 25 Apr 1998 15:12:33 -0400 In-Reply-To: Karl Pielorz's message of "Sat, 25 Apr 1998 19:42:30 +0100" Message-ID: <87zph990m6.fsf@kstreet.interlog.com> Lines: 17 X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Karl Pielorz writes: > There must be a better way of doing this in scripts? - Theres always the > chance another instance might start between me checking the lock file - and > creating the lock file... > > If there is no better way of doing this - I don't mind converting the whole > script to 'C' - in which case I presum 'man flock' is a good place to start? There's a little utility called lockfile which is distributed as part of procmail that can help with this. It has timeouts and retries and lock forcing options that are handy. -- Kevin Street street@iName.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message