ohadhawk has asked for the wisdom of the Perl Monks concerning the following question:
Hello dear monks,
My perl script performs some actions that may leave the system in an inconsistent state.
What I'd like to do is either roll back some actions on exit or notify the user running the script to do it manually.
I've assigned my own handlers to all the applicable termination signals, such as INT, ABRT, KILL, etc' and this works.
But the problem is that I don't know how to handle termination of the process by windows - either by the task manager or by closing the console window.
Does any wise monk know of a way for me to be able to catch the termination of the process ?
May light shine on your path :-)
My perl script performs some actions that may leave the system in an inconsistent state.
What I'd like to do is either roll back some actions on exit or notify the user running the script to do it manually.
I've assigned my own handlers to all the applicable termination signals, such as INT, ABRT, KILL, etc' and this works.
But the problem is that I don't know how to handle termination of the process by windows - either by the task manager or by closing the console window.
Does any wise monk know of a way for me to be able to catch the termination of the process ?
May light shine on your path :-)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Handling killing the perl process
by afoken (Chancellor) on Jan 04, 2010 at 10:01 UTC |
Back to
Seekers of Perl Wisdom