From owner-freebsd-hackers Mon Jan 28 9:13:14 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from lists.unixathome.org (lists.unixathome.org [210.48.103.158]) by hub.freebsd.org (Postfix) with ESMTP id B423C37B416 for ; Mon, 28 Jan 2002 09:13:05 -0800 (PST) Received: from wocker (lists.unixathome.org [210.48.103.158]) by lists.unixathome.org (8.11.6/8.11.6) with ESMTP id g0SHAID11872; Tue, 29 Jan 2002 06:10:18 +1300 (NZDT) (envelope-from dan@lists.unixathome.org) Message-Id: <200201281710.g0SHAID11872@lists.unixathome.org> From: "Dan Langille" Organization: DVL Software Limited To: Jason Andresen Date: Mon, 28 Jan 2002 12:10:15 -0500 MIME-Version: 1.0 Subject: Re: shell scripts that hang around forever Reply-To: dan@langille.org Cc: freebsd-hackers@freebsd.org In-reply-to: <3C556AC3.AFB26074@mitre.org> X-mailer: Pegasus Mail for Windows (v4.01) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thank you Jason. Yes, it would be helpful. And I had wondered if that was possible. Cheers. FWIW: I am now testing the script using the ports/sysutils/daemontools utilities. That seems to be working well so far. I will be writing a daemontools article for the Diary and will post the URL here for feedback before I make it public. On 28 Jan 2002 at 10:14, Jason Andresen wrote: > Wouldn't the following change be helpful if you always ^C the script to > stop it? > > > #!/bin/sh > > > > LOCKFILE=${HOME}/msgs/processing.lock > > MSGSDIR=${HOME}/msgs/FreeBSD/incoming > > cleanup() > { > rm -rf ${LOCKFILE} > exit > } > > trap cleanup sighup sigint sigquit sigill sigabrt sigterm > > > lockfile -r 0 $LOCKFILE > > RESULT=$? > > #echo result='$RESULT' > > if [ $RESULT = 0 ] > > then > > cd ${MSGSDIR} > > while . > > do > > FILECOUNT=`ls | wc -l` > > > > if [ $FILECOUNT -ne 0 ] > > then > > ls | xargs -n 1 $HOME/scripts/test-freebsd-cvs.sh > > fi > > > > sleep 1 > > done > > > cleanup > > fi -- Dan Langille The FreeBSD Diary - http://freebsddiary.org/ - practical examples To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message