On 02/25/2014 04:57 PM, Thomas Sattler wrote: > Am 25.02.2014 17:30, schrieb Pádraig Brady: >> On 02/25/2014 04:10 PM, Thomas Sattler wrote: >>> How about exporting the DURATION to the command's environment? >> >> So you mean for timeout(1) to inspect the env and honor a DURATION there? > > No, I thought of timeout(1) informing its child process about the > duration. So the command could know about the timeout. (Just for > the unusual case where it could want to know and care about it.) > > I'm aware that most commands run via timeout(1) will not make use > of this. On the other hand letting timeout(1) put the duration > into its client process' environment shouldn't hurt either.
I'm getting it hard to think of a use case where the managed command could make use of prior knowledge of the timeout. Related to this is the --preserve-status, where timeout(1) can indicate with a signal to the command when the DURATION expires, at which time the command can cleanup normally and timeout(1) will then propagate the status of the managed command. thanks, Pádraig.
