procmail
[Top] [All Lists]

Improvement to the manual page for lockfile

2014-06-04 09:51:06
lockfile is a program that can "succeed" and "fail" in a number of
distinct ways that the caller may want to distinguish.  As it says in
the manual page, "WARNINGS ... When testing lockfile's return value,
shell script writers should consider carefully whether they want to
use the -!  flag, simply reverse the test, or do a switch on the exact
exit‐code."

Unfortunately, the manual page does not describe the exit status
values, or how to distinguish the two success cases (ordinary success,
and forcing the lock).

So I propose to add this section to the manual page:

    EXIT STATUS

    Success is indicated by an exit status of 0.  Success after a
    timed-out lockfile was removed by force is indicated by an exit
    status of 0 with output to standard error including the text "Forcing
    lock on".  Failure because the number of retries was reached is
    indicated by an exit status of EX_CANTCREAT from sysexits.h (usually
    73).  Other failures are indicated by other non-zero exit statuses.
    All failures produce specific messages to standard error.
    If the -! flag is in effect, success is indicated by EX_CANTCREAT and
    retry failure is indicated by 0.

I believe that this is correct and complete.

Dale
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Improvement to the manual page for lockfile, Dale R. Worley <=