Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Handle SIGTERM on Linux

BTW, is SWT handling termination properly on Win and Mac?

The display's Close listener is invoked on Mac if the system is shutting down.

--
Best regards,
Thomas Singer
=============
syntevo GmbH
http://www.syntevo.com
http://www.syntevo.com/blog


On 2018-02-24 11:18, Aleksandar Kurtakov wrote:
On Sat, Feb 24, 2018 at 12:11 PM, Thomas Singer <ts-swt@xxxxxxxxxxx> wrote:

Hi Aleksandar,

Thanks for answering.

This is a good example on how to handle SIGTERM -
https://airtower.wordpress.com/2010/06/16/catch-sigterm-exit-gracefully/
.


Now the question is how to do that in a Java application?


That's a good question for which I don't know the answer. IMHO such work
would have to live in SWT (or some other part having C/JNI parts) where
such implementation can be done and CloseListeners to be called on SIGTERM.
This requires someone doing all the experiments and providing a patch.
BTW, is SWT handling termination properly on Win and Mac?



Cheers,
Tom



On 2/24/2018 10:56 AM, Aleksandar Kurtakov wrote:

On Sat, Feb 24, 2018 at 8:31 AM, Thomas Singer <ts-swt@xxxxxxxxxxx>
wrote:

Hello,

For Linux some users complain from time to time that SmartGit does not
store its settings when Linux is shut down while SmartGit is running.
SmartGit stores its settings when it is cleanly exited - either by
closing
all windows (main shells), by invoking the exit menu item or by the
display's Close-listener.

Could it be that the display's Close-listener is not invoked if Linux
sends a SIGTERM signal to tell the application to exit? How much time a
Linux application usually has to react on the SIGTERM signal? Thanks in
advance.


This is a good example on how to handle SIGTERM -
https://airtower.wordpress.com/2010/06/16/catch-sigterm-exit-gracefully/
.
In general there is no limitation for the time the handler should take but
note that it will eventually receive SIGKILL if it takes too long. It's
worth trying whether your CloseListener is called when killing the process
with console kill. I have never looked into whether SWT does smth like
that.



--
Best regards,
Thomas Singer
=============
syntevo GmbH
http://www.syntevo.com
http://www.syntevo.com/blog
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev






_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev






_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top