On Thu, 2006-03-30 at 04:41, Charles Steinkuehler wrote:
> Mike Noyes wrote:
> > Ugh! They went on for quite a while on that thread. I'm not sure what
> > discussed method was finally used..
> > 
> > http://moongroup.com/pipermail/shell.scripting/2005-February/thread.html#9396
> 
> The reason they're not just using the -l switch to lockfile is the
> person who started the thread is wanting to do something different in
> the script if a stale lockfile is found:
> http://moongroup.com/pipermail/shell.scripting/2005-February/009410.html

Charles,
Thanks for explaining. :-)

> If you're concerned about this, we'd need to jump through the same hoops
> they're mentioning in the thread.  Personally, I think one of the two
> "easy" options would work for us:

I think my exposure to the SF staff has made me overly concerned with
stale locks. They spend a considerable amount of time attending to cvs
stale locks.

> 1) No automatic stale lockfile removal.  If anything goes wrong with the
> script and a lockfile is left on the system, an administrator will have
> to login, check things out, and clear the lockfile.
> 
> 2) Lockfile automatically removed after some (long compared to document
> creation) time.  This would handle the cases where the script died for
> some reason and didn't remove the lockfile, but could potentially cause
> problems if a previous script is still running for whatever reason.
> 
> I'd probably suggest going with #1 for now...the worst case is documents
> don't get automatically generated for a while if an admin doesn't look
> at things immediately.  

Agreed.

> I mentioned the -l switch to lockfile since I
> wasn't sure if your removal of the lockfile when trying to grab it
> failed was unintentional, or an attempt at forcibly grabbing it.

I was trying to clear the lockfile before exiting in case of failure,
just as your example clears the lockfile on success. I didn't do it
right though.

>From what I understand of the -l switch, it will grab the lock file if
it's older than the specified time. It does appear to take a few seconds
for this to occur though. Not a big concern in a cron script.

        Note: I'll need to shorten the -l time for my test runs.

-- 
Mike Noyes <mhnoyes at users.sourceforge.net>
http://sourceforge.net/users/mhnoyes/
SF.net Projects: leaf, phpwebsite, phpwebsite-comm, sitedocs



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

_______________________________________________
leaf-devel mailing list
leaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to