FreshPorts2 will have a new processing strategy for incoming
messages. Each message will be in a separate file in a predetermined
directory. As each file arrives, it is processed by a perl script. I want
only one instance of that perl script running at a given time. This is
primarily for serialization and to ensure the system doesn't get bogged
down running perl scripts if many messages arrive in a short period of
time.
My idea is to have a daemon, or something resembling one, sitting on
the box watching the directory. When a new file appears, it starts a perl
script. This perl script is beyound the scope of my question, but it
processes all the files in the directory. When finished, it looks for any
more files and repeats as necessary. If no more files, it exits.
If a file arrives, the daemon checks to see if the perl script is already
running. If so, it doesn't start another one.
Any ideas on how to do this? Any suggestions on the process?
--
Dan Langille
The FreeBSD Diary - http://freebsddiary.org/
FreshPorts - http://freshports.org/
NZ Broadband - http://unixathome.org/broadband/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message