#shutDown: and OS events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

#shutDown: and OS events

Brian Brown-2
Hello list,

Is there a mechanism for Squeak to handle an OS request to exit, such  
as someone rebooting their machine? It seems that the #shutDown:  
machinery would not be triggered in that case and any image changes  
would be lost in those cases.

I understand that those changed items would be in the changes file;  
might it be possible to automatically recover them if desired for some  
subset of changes?


Any advice would be helpful!


- Brian
 

Reply | Threaded
Open this post in threaded view
|

Re: #shutDown: and OS events

Randal L. Schwartz
>>>>> "Brian" == Brian Brown <[hidden email]> writes:

Brian> Is there a mechanism for Squeak to handle an OS request to exit, such
Brian> as someone rebooting their machine? It seems that the #shutDown:
Brian> machinery would not be triggered in that case and any image changes
Brian> would be lost in those cases.

If you're talking about Unix, most versions of Unix that I've seen send a
SIGHUP to every process and wait a bit before actually shutting down.

You can set up a wait-for-SIGHUP with UnixProcess (part of OSProcess),
and take appropriate action when you see it.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!