Subject: Re: kill(1) a pid after timeout
To: None <tech-userlevel@netbsd.org>
From: Bill Stouder-Studenmund <wrstuden@netbsd.org>
List: tech-userlevel
Date: 07/24/2007 21:21:23
--ftEhullJWpWg/VHq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, Jul 24, 2007 at 10:47:46AM -0700, Jan Schaumann wrote:
> Hi,
>=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?
I can see a use for this.
What will kill do after this change if the process exits before the=20
timeout? Further, say another process gets started using the same PID=20
before the timeout. Will it get killed instead?
Take care,
Bill
--ftEhullJWpWg/VHq
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)
iD8DBQFGps/DWz+3JHUci9cRAlJXAJ9FfSklScasDm1cdvf9ZLI01ICotQCfY41E
rc5VISWlM/GSbEYlkcpxFMs=
=v3q1
-----END PGP SIGNATURE-----
--ftEhullJWpWg/VHq--