[Lazarus] Finding out how a program's being terminated

waldo kitty wkitty42 at windstream.net
Sat Feb 16 21:11:59 CET 2013


On 2/16/2013 12:43, Michael Van Canneyt wrote:
>
>
> On Sat, 16 Feb 2013, waldo kitty wrote:
>
>> On 2/16/2013 08:30, Hans-Peter Diettrich wrote:
>>> Procedures even may be different for Linux and Windows, depending on the
>>> signal/message types. Even if a program can ignore SIGTERM, can it also inform
>>> the system that it doesn't *want* to close? On Windows a program can stop an
>>> shutdown, maybe not on other platforms.
>>
>> i have exactly this problem to deal with on *nix... my app needs to be allowed
>> to complete its shutdown closeout procedures or there are problems on the next
>> boot when it is started up... on shutdown, app managed data is removed from a
>> living data file to another file for restoration on startup... this takes
>> longer than 5 seconds and it hurts at times when the system sigkills the app :/
>
> Why not just rename the file and do the cleanup on startup ?

because not all the data in the file is managed by the app... some of the data 
is managed by human hands... some of it may be managed by another app... all 
three, human, other app, and my app all share the same data file because it is 
tied into the system's other management controls...

FWIW: the apps are firewall rules management apps and the data file is used by 
the GUI to show the firewall rules in place... back end code uses the system's 
existing iptables code to add, remove and edit the firewall rules... when an app 
shuts down, it removes its rules from the list and from the iptables... in the 
end, the only permanent rules are those that the human placed...

i was hoping to find a solution so that the app didn't have to be rewritten to 
use another iptables section, data file and a whole other set of GUI management 
screens...





More information about the Lazarus mailing list