1 <?xml version=
"1.0" encoding=
"utf-8"?>
5 Written by Michael Tokarev <mjt@tls.msk.ru>
10 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook V4.4//EN"
11 "file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
17 <email>mjt@tls.msk.ru
</email>
20 <firstname>Michael
</firstname>
21 <surname>Tokarev
</surname>
23 <date>2007-
08-
15</date>
27 <refentrytitle>lckdo
</refentrytitle>
28 <manvolnum>1</manvolnum>
32 <refname>lckdo
</refname>
33 <refpurpose>run a program with a lock held
</refpurpose>
38 <command>lckdo
</command>
40 <arg choice=
"req">lockfile
</arg>
41 <arg choice=
"req">program
</arg>
47 <title>DESCRIPTION
</title>
49 <para><command>lckdo
</command> runs a program with a lock
50 held, in order to prevent multiple processes from running in
51 parallel. Use just like
<command>nice
</command> or
52 <command>nohup
</command>.
</para>
54 <para>Now that util-linux contains a similar command
55 named
<command>flock
</command>, lckdo is deprecated,
56 and will be removed from some future version of moreutils.
62 <title>OPTIONS
</title>
67 <term><option>-w
</option></term>
69 <para>If the lock is already held by another process,
70 wait for it to complete instead of failing
76 <term><option>-W {sec}
</option></term>
78 <para>The same as -w but wait not more than sec
84 <term><option>-e
</option></term>
86 <para>Execute the program directly without forking and
87 waiting (keeps an extra file descriptor open).
</para>
92 <term><option>-E {nnn}
</option></term>
94 <para>Set the file descriptor number to keep open when
95 exec()ing (implies -e).
</para>
100 <term><option>-n
</option></term>
102 <para>Do not create the lock file if it does not
108 <term><option>-q
</option></term>
110 <para>Produce no output if lock is already held.
</para>
115 <term><option>-s
</option></term>
117 <para>Lock in shared (read) mode.
</para>
122 <term><option>-x
</option></term>
124 <para>Lock in exclusive (write) mode (default).
</para>
129 <term><option>-t
</option></term>
131 <para>Test for lock existence.
</para>
140 <title>EXIT STATUS
</title>
142 <para>If the lock was successfully acquired, the return value is that
143 of the program invoked by
<command>lckdo
</command>. If the lock
144 couldn't be acquired, EX_TEMPFAIL is returned. If there was a problem
145 opening/creating or locking the lock file, EX_CANTCREAT or EX_OSERR
146 will be returned.
</para>
151 <title>AUTHOR
</title>