1 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 .\" Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org>
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd run a command with a time limit
37 .Op Fl -signal Ar sig | Fl s Ar sig
38 .Op Fl -preserve-status
39 .Op Fl -kill-after Ar time | Fl k Ar time
52 is still running after
60 zero, signifies no limit.
61 Therefore a signal is never sent if
65 The options are as follows:
66 .Bl -tag -width indent
67 .It Fl -preserve-status
68 Exit with the same status as
70 even if it times out and is killed.
72 Do not propagate timeout to the children of
74 .It Fl s Ar sig , Fl -signal Ar sig
75 Specify the signal to send on timeout.
79 .It Fl k Ar time , Fl -kill-after Ar time
84 is still running after
86 after the first signal was sent.
92 are non-negative integer or real (decimal) numbers, with an optional
93 unit-specifying suffix.
94 Values without an explicit unit are interpreted as seconds.
96 Supported unit symbols are:
97 .Bl -tag -width indent -compact
108 If the timeout was not reached, the exit status of
112 If the timeout was reached and
114 is set, the exit status of
119 is not set, an exit status of 124 is returned.
123 exits after receiving a signal, the exit status returned is the signal number
128 refers to a non-existing program, the exit status returned is 127.
132 is an otherwise invalid program, the exit status returned is 126.
134 If an invalid parameter is passed to
138 the exit status returned is 125.
145 command first appeared in
148 .An Baptiste Daroussin Aq Mt bapt@FreeBSD.org
150 .An Vsevolod Stakhov Aq Mt vsevolod@FreeBSD.org