OSProcess: making sure that a child process always dies

Joshua Gargus schwa at fastmail.us
Thu Mar 15 18:12:01 UTC 2007


Hi David,

Thanks, that's what I had implemented.  However, the OS X VM has a  
menu item "Quit do not save" which appears not to go through the  
regular Squeak shutdown process.  Also, you never know when you'll  
have to terminate an image with "extreme prejudice" :-)

I suppose that another option would be to stash the pids in a file  
and kill them on startup.

Thanks to you and John for the suggestions.  I'm not a unix expert,  
and I had no idea what support the underlying APIs had for this use  
case.

Cheers,
Josh


On Mar 15, 2007, at 4:58 AM, David T. Lewis wrote:

> On Thu, Mar 15, 2007 at 12:15:01AM -0700, Joshua Gargus wrote:
>> Hi,
>>
>> Is there a way to use OSProcess on OS X (or unix in general) to cause
>> forked child processes to die when the parent Squeak process quits?
>
> You can keep track of the process proxy for the forked child
> process, and explicitly terminate it when you exit Squeak, possibly
> as part of a class #shutDown: method.
>
> For example, you can kill all child processes like this:
>   OSProcess thisOSProcess allMyChildren do: [:e | e terminate]
>
> Dave
>
>




More information about the Squeak-dev mailing list