command runs a specified program for at most a given number of
.IR seconds .
.PP
It works by running the given command as a separate process group. It
then waits either for the top-level process (only) to exit, or for the
timeout to expire, whichever happens first. If the process exits, then
command runs a specified program for at most a given number of
.IR seconds .
.PP
It works by running the given command as a separate process group. It
then waits either for the top-level process (only) to exit, or for the
timeout to expire, whichever happens first. If the process exits, then
exits too, setting its exit status to match. Any other processes which
may have been started are left unmolested.
.PP
On the other hand, if the timeout goes off, then
exits too, setting its exit status to match. Any other processes which
may have been started are left unmolested.
.PP
On the other hand, if the timeout goes off, then
sends its child process group the specified signal, by default
.BR SIGTERM ,
though you can choose a different one with the
sends its child process group the specified signal, by default
.BR SIGTERM ,
though you can choose a different one with the
.B SIGKILL
to the process group and waits a further five seconds. If the child
still hasn't exited in this time, then
.B SIGKILL
to the process group and waits a further five seconds. If the child
still hasn't exited in this time, then
had to kill the child because it took too long, then its exit status
will be like this.
.TP
251
The child took too long and couldn't be killed:
had to kill the child because it took too long, then its exit status
will be like this.
.TP
251
The child took too long and couldn't be killed:
works by running its child process in a separate process group, it
interacts oddly with interactive shells. If the child process group
attempts to do terminal I/O (particularly reading from a terminal) then
works by running its child process in a separate process group, it
interacts oddly with interactive shells. If the child process group
attempts to do terminal I/O (particularly reading from a terminal) then
program makes an effort to propagate interesting signals to its child
process group. Currently, it propagates
.BR SIGTSTP ,
program makes an effort to propagate interesting signals to its child
process group. Currently, it propagates
.BR SIGTSTP ,
and its child process group, the timer continues running anyway. (I'm
not quite sure whether this is the right behaviour.)
.PP
and its child process group, the timer continues running anyway. (I'm
not quite sure whether this is the right behaviour.)
.PP
earlier than the inner one. Since
.B SIGTERM
isn't propagated (currently, at least), the inner
earlier than the inner one. Since
.B SIGTERM
isn't propagated (currently, at least), the inner
is killed by the outer one, and loses control of its child process
group. You could possibly work around this by sending
.B SIGQUIT
is killed by the outer one, and loses control of its child process
group. You could possibly work around this by sending
.B SIGQUIT