| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: timeout.1,v 1.2 2014/08/01 14:01:30 christos Exp $ | | 1 | .\" $NetBSD: timeout.1,v 1.3 2014/08/02 06:20:56 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org> | | 3 | .\" Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org> |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" | | 14 | .\" |
| @@ -24,62 +24,62 @@ | | | @@ -24,62 +24,62 @@ |
24 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 24 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
25 | .\" SUCH DAMAGE. | | 25 | .\" SUCH DAMAGE. |
26 | .\" | | 26 | .\" |
27 | .\" $FreeBSD: head/usr.bin/timeout/timeout.1 268861 2014-07-18 22:56:59Z bapt $ | | 27 | .\" $FreeBSD: head/usr.bin/timeout/timeout.1 268861 2014-07-18 22:56:59Z bapt $ |
28 | .\" | | 28 | .\" |
29 | .Dd July 19, 2014 | | 29 | .Dd July 19, 2014 |
30 | .Dt TIMEOUT 1 | | 30 | .Dt TIMEOUT 1 |
31 | .Os | | 31 | .Os |
32 | .Sh NAME | | 32 | .Sh NAME |
33 | .Nm timeout | | 33 | .Nm timeout |
34 | .Nd run a command with a time limit | | 34 | .Nd run a command with a time limit |
35 | .Sh SYNOPSIS | | 35 | .Sh SYNOPSIS |
36 | .Nm | | 36 | .Nm |
37 | .Op Fl -signal Ar sig | Fl s Ar sig | | 37 | .Op Fl Fl signal Ar sig | Fl s Ar sig |
38 | .Op Fl -preserve-status | | 38 | .Op Fl Fl preserve-status |
39 | .Op Fl -kill-after Ar time | Fl k Ar time | | 39 | .Op Fl Fl kill-after Ar time | Fl k Ar time |
40 | .Op Fl -foreground | | 40 | .Op Fl Fl foreground |
41 | .Ao Ar duration Ac | | 41 | .Ao Ar duration Ac |
42 | .Ao Ar command Ac | | 42 | .Ao Ar command Ac |
43 | .Ao Ar args ... Ac | | 43 | .Ao Ar args ... Ac |
44 | .Sh DESCRIPTION | | 44 | .Sh DESCRIPTION |
45 | .Nm | | 45 | .Nm |
46 | starts the | | 46 | starts the |
47 | .Ar command | | 47 | .Ar command |
48 | with its | | 48 | with its |
49 | .Ar args. | | 49 | .Ar args . |
50 | If | | 50 | If |
51 | .Ar command | | 51 | .Ar command |
52 | is still running after | | 52 | is still running after |
53 | .Ar duration , | | 53 | .Ar duration , |
54 | it is killed. | | 54 | it is killed. |
55 | By default, | | 55 | By default, |
56 | .Ar SIGTERM. | | 56 | .Dv SIGTERM . |
57 | is sent. | | 57 | is sent. |
58 | .Bl -tag -width "-k time, --kill-after time" | | 58 | .Bl -tag -width "-k time, --kill-after time" |
59 | .It Fl -preserve-status | | 59 | .It Fl Fl preserve-status |
60 | Always exits with the same status as | | 60 | Always exits with the same status as |
61 | .Ar command | | 61 | .Ar command |
62 | even if it times out. | | 62 | even if it times out. |
63 | .It Fl -foreground | | 63 | .It Fl Fl foreground |
64 | Do not propagate timeout to the | | 64 | Do not propagate timeout to the |
65 | .Ar command | | 65 | .Ar command |
66 | children. | | 66 | children. |
67 | .It Fl s Ar sig , Fl -signal Ar sig | | 67 | .It Fl s Ar sig , Fl Fl signal Ar sig |
68 | Specify the signal to send on timeout. | | 68 | Specify the signal to send on timeout. |
69 | By default, | | 69 | By default, |
70 | .Ar SIGTERM . | | 70 | .Dv SIGTERM . |
71 | is sent. | | 71 | is sent. |
72 | .It Fl k Ar time , Fl -kill-after Ar time | | 72 | .It Fl k Ar time , Fl Fl kill-after Ar time |
73 | Send a second kill signal if | | 73 | Send a second kill signal if |
74 | .Ar command | | 74 | .Ar command |
75 | is still running after | | 75 | is still running after |
76 | .Ar time | | 76 | .Ar time |
77 | after the first signal was sent. | | 77 | after the first signal was sent. |
78 | .El | | 78 | .El |
79 | .Sh DURATION FORMAT | | 79 | .Sh DURATION FORMAT |
80 | .Ar duration | | 80 | .Ar duration |
81 | and | | 81 | and |
82 | .Ar time | | 82 | .Ar time |
83 | can be integer or decimal numbers. | | 83 | can be integer or decimal numbers. |
84 | Values without unit symbols are interpreted as seconds. | | 84 | Values without unit symbols are interpreted as seconds. |
85 | .Pp | | 85 | .Pp |
| @@ -90,41 +90,44 @@ seconds | | | @@ -90,41 +90,44 @@ seconds |
90 | .It m | | 90 | .It m |
91 | minutes | | 91 | minutes |
92 | .It h | | 92 | .It h |
93 | hours | | 93 | hours |
94 | .It d | | 94 | .It d |
95 | days | | 95 | days |
96 | .El | | 96 | .El |
97 | .Sh EXIT STATUS | | 97 | .Sh EXIT STATUS |
98 | If the timeout was not reached, the exit status of | | 98 | If the timeout was not reached, the exit status of |
99 | .Ar command | | 99 | .Ar command |
100 | is returned. | | 100 | is returned. |
101 | .Pp | | 101 | .Pp |
102 | If the timeout was reached and | | 102 | If the timeout was reached and |
103 | .Fl -preserve-status | | 103 | .Fl Fl preserve-status |
104 | is set, the exit status of | | 104 | is set, the exit status of |
105 | .Ar command | | 105 | .Ar command |
106 | is returned. | | 106 | is returned. |
107 | If | | 107 | If |
108 | .Fl -preserve-status | | 108 | .Fl Fl preserve-status |
109 | is not set, an exit status of 124 is returned. | | 109 | is not set, an exit status of 124 is returned. |
110 | .Pp | | 110 | .Pp |
111 | If | | 111 | If |
112 | .Ar command | | 112 | .Ar command |
113 | exits after receiving a signal, the exit status returned is the signal number plus 128. | | 113 | exits after receiving a signal, the exit status returned is the signal number plus 128. |
114 | .Sh SEE ALSO | | 114 | .Sh SEE ALSO |
115 | .Xr kill 1 , | | 115 | .Xr kill 1 , |
116 | .Xr signal 3 | | 116 | .Xr signal 3 |
117 | .Sh HISTORY | | 117 | .Sh HISTORY |
118 | A | | 118 | A |
119 | .Nm | | 119 | .Nm |
120 | utility appeared in a development branch of | | 120 | utility appeared in a development branch of |
121 | .Fx 11 | | 121 | .Fx 11 |
122 | and was imported into | | 122 | and was imported into |
123 | .Nx 7 . | | 123 | .Nx 7 . |
124 | The | | 124 | The |
125 | .Fx | | 125 | .Fx |
126 | work is compatible with GNU | | 126 | work is compatible with GNU |
127 | .Xr timeout 1 | | 127 | .Nm |
128 | by Padraig Brady, from GNU Coreutils 8.21. The | | 128 | by |
129 | .Xr timeout 1 | | 129 | .An Padraig Brady , |
| | | 130 | from GNU Coreutils 8.21. |
| | | 131 | The |
| | | 132 | .Nm |
130 | utility first appeared in GNU Coreutils 7.0. | | 133 | utility first appeared in GNU Coreutils 7.0. |