Subject: Re: kill(1) a pid after timeout
To: None <tech-userlevel@netbsd.org>
From: Jan Schaumann <jschauma@netmeister.org>
List: tech-userlevel
Date: 07/24/2007 15:36:30
--envbJBWh7q8WU6mo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Andrew Doran <ad@netbsd.org> wrote:
=20
> > 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).
> >=20
> > Does that seem useful to others as well?
>=20
> When would this do something different than ulimit & SIGXCPU?

You mean:

$ ulimit -t 500
$ invoke_long_command &

?

I want to be able to kill processes that have not been started with a
fixed ulimit.

-Jan

--=20
As we all know, reality is a mess.
	Larry Wall

--envbJBWh7q8WU6mo
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)

iD8DBQFGpn7ufFtkr68iakwRAg0xAJ9HJqqN2tQwEn/7ru7PehzKCxsGJQCZAY2q
EldEwsmdAE/YghbE+u0gk5k=
=LsJ6
-----END PGP SIGNATURE-----

--envbJBWh7q8WU6mo--