Subject: Re: TRAP lockfiles

From: [email-masked] (Marc A. Tamsky)
Date: Wed, 11 Jan 95 15:37 PST

Joe Hildebrand <[email-masked]> wrote:
} Is it possible to put a lockfile on the execution of the contents of
} the TRAP variable?  Or, alternately, is there a better way to update
} an "active" file that contains the last numbered file (MH-style) for
} each folder than:

} TRAP='$MAILDIR/add-active $LASTFOLDER'

} where add-active is a script that parses LASTFOLDER, then updates a
} file with the new count.

I looked for the same thing myself, but I cam up with the following
trick that works for me... but the order that my TRAP gets invoked
isn't that important to me:

TRAP="/usr/local/bin/procmail -m LASTFOLDER=\$LASTFOLDER $HOME/.procmailrc-trap"

I have a special .procmail-trap file that processes the LASTFOLDER
variable and creates a custom archive-log for me.

Perhaps something similar could be used for your task?

-- 
| Marc Tamsky -- [email-masked] - Linux, the choice of generation-GNU.
|     Protect your rights: learn, use, and practice safe encryption.
|
| "A witty saying proves nothing."                 -- Voltaire (1694-1778)

---

From: Joe Hildebrand <[email-masked]>
Date: Thu, 12 Jan 1995 15:01:39 -0500

> "Joe" == Joe Hildebrand <[email-masked]> wrote:

   Joe> where add-active is a script that parses LASTFOLDER, then
   Joe> updates a file with the new count.

> "Marc" == Marc A Tamsky <[email-masked]> writes:

   Marc> I looked for the same thing myself, but I cam up with the
   Marc> following trick that works for me... but the order that my
   Marc> TRAP gets invoked isn't that important to me:

   Marc> TRAP="/usr/local/bin/procmail -m LASTFOLDER=\$LASTFOLDER
   Marc> $HOME/.procmailrc-trap"

   Marc> I have a special .procmail-trap file that processes the
   Marc> LASTFOLDER variable and creates a custom archive-log for me.

Actually, I solved the problem by making my scripts a little smarter.
I put a call to "lockfile active.lock" and "rm -f active.lock"
around the critical sections of each script.

-- 
Joe Hildebrand                  Fuentez Systems Concepts
[email-masked]              11781 Lee-Jackson Hwy, Suite 700
Senior Software Engineer        Fairfax, VA 22033
                                Phone:    (703)273-1447   
                                Fax:      (703)273-2972
                                PGPprint: 0x06C96661

Standard disclaimers apply