[Gllug] killing a process and child processes

Andy Smith andy at lug.org.uk
Mon Jun 25 15:08:04 UTC 2007


On Mon, Jun 25, 2007 at 04:56:59PM +0200, salsaman at xs4all.nl wrote:
> On Mon, June 25, 2007 16:52, Andy Smith wrote:
> > Hi,
> >
> > On Mon, Jun 25, 2007 at 04:42:14PM +0200, salsaman at xs4all.nl wrote:
> >> I need some code which does the following - send a sighup to a process
> >> and
> >> all child processes of that process.
> >
> > kill with a negative process ID?
> 
> Yes !
> 
> But how do I get the process group of "/usr/bin/foo" ?

You don't need to; get its process ID and then kill -<pid>.  You
could use pgrep to find it if you didn't store it when foo was
started.

Cheers,
Andy

-- 
http://bitfolk.com/ -- No-nonsense VPS hosting
Encrypted mail welcome - keyid 0x604DE5DB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20070625/98e6416c/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list