Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "SHLOCK 1"
SHLOCK 1 "2015-09-12" "INN 2.6.4" "InterNetNews Documentation"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
shlock - Create lock files for use in shell scripts
"SYNOPSIS"
Header "SYNOPSIS" \fBshlock [-b|-c|-u] -f name -p pid
"DESCRIPTION"
Header "DESCRIPTION" \fBshlock tries to create a lock file named name and write the process \s-1ID\s0 pid into it. If the file already exists, shlock will read the process \s-1ID\s0 from the file and test to see whether the process is currently running. If the process exists, then the file will not be created. shlock exits with a zero status if it could create the lock file, or non-zero if the file refers to a currently active process.

A Perl wrapper around shlock can be used via the \*(C`INN::Utils::Shlock\*(C' module.

"OPTIONS"
Header "OPTIONS"
"-b" 4
Item "-b" Process IDs are normally read and written in \s-1ASCII.\s0 If the -b flag is used, then they will be written as a binary int.
"-c" 4
Item "-c" If the -c flag is used, then shlock will not create a lock file, but will instead use the file to see if the lock is held by another program. If the lock is valid, the program will exit with a non-zero status; if the lock is not valid (i.e. invoking shlock without the flag would have succeeded), then the program will exit with a zero status.
"-f name" 4
Item "-f name" \fIname is the name of the lock file shlock attempts to create. If the file already exists, it will read the process \s-1ID\s0 from the file and exit with a non-zero status if this process is currently active.
"-p pid" 4
Item "-p pid" \fIpid is the process \s-1ID\s0 to write into the file name.
"-u" 4
Item "-u" For compatibility with other systems, the -u flag is accepted as a synonym for -b since binary locks are used by many \s-1UUCP\s0 packages.
"EXAMPLES"
Header "EXAMPLES" The following example shows how shlock would be used within a shell script:

.Vb 7 LOCK=<pathrun in inn.conf>/LOCK.send trap \*(Aqrm -f ${LOCK} ; exit 1\*(Aq 1 2 3 15 if shlock -p $$ -f ${LOCK} ; then # Do appropriate work. else echo "Locked by \`cat ${LOCK}\`" fi .Ve

"HISTORY"
Header "HISTORY" Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews after a description of \s-1HDB UUCP\s0 locking given by Peter Honeyman, and improved by Berend Reitsma to solve a race condition. Converted to \s-1POD\s0 by Julien Elie.

\f(CW$Id: shlock.pod 9303 2011-08-04 22:09:57Z iulius $

"SEE ALSO"
Header "SEE ALSO" \fBINN::Utils::Shlock\|(3pm).