Subject: Re: kill(1) a pid after timeout
To: None <tech-userlevel@netbsd.org>
From: Martin S. Weber <Ephaeton@gmx.net>
List: tech-userlevel
Date: 07/25/2007 00:25:54
On Tue, Jul 24, 2007 at 10:50:02PM +0100, Andrew Doran wrote:
> Hi Jan,
> 
> On Tue, Jul 24, 2007 at 10:47:46AM -0700, Jan Schaumann wrote:
> 
> > I occasionally have the need to kill a process iff it has been running
> > for longer than N seconds.  Instead of parsing the output of ps(1) and
> > then calling kill(1) myself, I have attached a patch to add the "-t
> > timeout" flag to kill(1).
> > 
> > Does that seem useful to others as well?
> 
> When would this do something different than ulimit & SIGXCPU?
> 

* wall time, not cpu time ?
* Time accounted for by children ?
* kills "now" if necessary (timedout) not somewhen in future ?

my personal opinion tho is - use a shell script:
 http://catb.org/~esr/writings/unix-koans/ten-thousand.html

Regards,

-Martin