[Nagiosplug-devel] Timeouts in BASH Plugins

Mikael Fridh frimik at gmail.com
Sat Aug 30 03:25:25 CEST 2008


On Thu, Aug 28, 2008 at 5:55 PM, Richard Edward Horner
<rich at richhorner.com> wrote:
>
> trap timeout USR1
>     ( sleep 6 ; ) &
> trap - USR1
>
> If I run that chunk of code locally, its runtime is less than a
> second. If I run it over NRPE, it's runtime is over 6 seconds because
> it is not backgrounding the sleep call. It's as if there's a wait
> somewhere (there's not).

A process won't fully detach unless you redirect all input and output,
like this:
( sleep 6 ; ) </dev/null &>/dev/null

--
Mike




More information about the Devel mailing list