Discussion:
Import timeout(1) from FreeBSD
Kamil Rytarowski
2014-07-27 10:58:36 UTC
Permalink
Hello,
 
The FreeBSD team produced BSD-licensed timeout(1).
 
Sources http://svnweb.freebsd.org/base?view=revision&revision=268745
Production https://phabric.freebsd.org/D377
 
Is it a good idea to import their result into our base trees?
This tool will make my life easier, my use case is doing tests of a certain executable, grab results logs from a certain time (like 1-60 sec) and then repeat N times. I was using subshells, transfering PID and then using the kill(1) command.
 
Some utilities contain a timeout option, but it won't necessarily help if a process hangs.

My goal is not to find a walk-around using chain of existing tools (so increasing burden in shell scripts), but make life easier taking this specialized tool.
 
With regards.
Christos Zoulas
2014-07-27 19:34:48 UTC
Permalink
In article <trinity-4cc9f7c8-a188-4131-922b-b4afca596bc9-***@3capp-mailcom-bs15>,
Kamil Rytarowski <***@gmx.com> wrote:
>Hello,
> 
>The FreeBSD team produced BSD-licensed timeout(1).
> 
>Sources http://svnweb.freebsd.org/base?view=revision&revision=268745
>Production https://phabric.freebsd.org/D377
> 
>Is it a good idea to import their result into our base trees?
>This tool will make my life easier, my use case is doing tests of a
>certain executable, grab results logs from a certain time (like 1-60
>sec) and then repeat N times. I was using subshells, transfering PID and
>then using the kill(1) command.
> 
>Some utilities contain a timeout option, but it won't necessarily help
>if a process hangs.
>
>My goal is not to find a walk-around using chain of existing tools (so
>increasing burden in shell scripts), but make life easier taking this
>specialized tool.
> 
>With regards.

LGTM... What do others think?

christos
Eric Haszlakiewicz
2014-07-28 16:23:37 UTC
Permalink
On July 27, 2014 3:34:48 PM EDT, ***@astron.com wrote:
>In article
><trinity-4cc9f7c8-a188-4131-922b-b4afca596bc9-***@3capp-mailcom-bs15>,
>Kamil Rytarowski <***@gmx.com> wrote:
>>Hello,
>>��
>>The FreeBSD team produced BSD-licensed timeout(1).
>>��
>>Sources http://svnweb.freebsd.org/base?view=revision&revision=268745
>>Production https://phabric.freebsd.org/D377
>>��
>>Is it a good idea to import their result into our base trees?
>
>LGTM... What do others think?
>
>christos

Sounds useful, let's import it.

Eric
Kamil Rytarowski
2014-07-31 01:36:19 UTC
Permalink
Hello,

I've filed a problem-report (hopefully it won't be sorted out by spam-filters) with a proposed patches.

The former aims to import FreeBSD sources as they are, the latter to adapt timeout(1) for NetBSD.

Comments and tests are welcome... after midnight coding!

The patches are waiting for a sponsor to review and push them to the mainline for NetBSD-7.0.

If I'm not mistaken in the FreeBSD version there is a bug, it permits to use a signal out range -- this line is exposed with strtonum(3). We don't ship with strtonum(3), so I changed it to strtol(3) and assumed that sig_nsig is not a valid signal value.

strtonum(3) is an OpenBSD addition, available in FreeBSD and in GNU.

With kind regards,
Loading...