[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Only one process



Umm, don't run the script milliseconds apart? When I say every once in
a while I mean something like every 15 minutes. If your situation
calls for constantly checking to see if the process is running, then
my solution probably isn't for you. But your process is even remotely
reliable (i.e. doesn't crash 3 seconds after you start it) then it
would likely work out well.

On Fri, Jun 4, 2010 at 8:49 PM, JK <jknapka at kneuro.net> wrote:
> Doesn't anybody worry about race conditions any more? ?How do you
> defend against multiple copies of this script running simultaneously?
> Of course, cron *shouldn't* ever do that...
>
> flock(1) seems relevant:
>
> http://linux.die.net/man/1/flock
>
> -- JK



-- 
James Sumners
http://james.roomfullofmirrors.com/

"All governments suffer a recurring problem: Power attracts
pathological personalities. It is not that power corrupts but that it
is magnetic to the corruptible. Such people have a tendency to become
drunk on violence, a condition to which they are quickly addicted."

Missionaria Protectiva, Text QIV (decto)
CH:D 59