SPUG:

Creede Lambard creede at penguinsinthenight.com
Mon Aug 26 18:40:08 CDT 2002


I'd say, every time program A or program B runs, save its PID in a file
somewhere (or database table, or whatever). Then, when you decide to
shut down, go through the list in that file and kill all the pids in it.

If you do this be sure to remove the PID entry when an instance of the
program exits or you could cause yourself unnecessary work.

On Mon, 2002-08-26 at 15:16, Baker, Stephen M wrote:
> 
> 
> I'm looking for the correct exit command for the following situation:
> 
> Program A coninuously checks environment conditions and runs Program B as
> necessary.
> 
> Each time Program B runs, it spawns multiple instances of program C.
> 
> Eventually, Programs B and C complete execution, modify the environment, and
> Program A again notices changes and restarts the cycle.
> 
> I have the program catching signal interrupts for exit purposes, but I don't
> know whether to go with a kill 9, an exit(?), or what.
> 
> What I want to do when exit is called is kill all instances of programs A
> and B, but not any occurances of program C.
> 
> 
> 
> 
> Stephen Baker				Office:	253.371.4188
> Intel Corporation				Mobile:	253.678.0556 
> Intel Architecture Group			Email:
> stephen.m.baker at intel.com
> 
> Mail Stop DP3-307	2800 Center Dr.		Dupont, WA 98327
> 
> ****************************************************************************
> **************
> The information contained in this email are the opinions and views of the 
> author(s), and are not on behalf of Intel unless specifically stated.
> ****************************************************************************
> **************
> 
> 
> 
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
>  For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
>      Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
> 
-- 
 * .~. `(  ------------------------------------------------------------
` / V \  . Creede Lambard                : Live in a world of your own,
 /(   )\   creede at penguinsinthenight.com : but always welcome visitors.
  ^^-^^    ------------------------------------------------------------

Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within.
GPG key at http://www.penguinsinthenight.com/creede_public_key.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
Url : http://mail.pm.org/archives/spug-list/attachments/20020826/dc5b3104/attachment.bin


More information about the spug-list mailing list