Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHeadless Equinox Clean Shutdown?
https://www.eclipse.org/forums/index.php/mv/msg/31771/103029/#msg_103029
Originally posted by: paule.willcode4beer.com
I'm looking at building a startup/shutdown script to run a headless
Equinox from "/etc/init.d".
Is there a "nice" way to shutdown the Equinox instance instead of just
sending a kill?
thx]]>2007-12-24T18:32:13-00:00Re: Headless Equinox Clean Shutdown?
https://www.eclipse.org/forums/index.php/mv/msg/31771/103045/#msg_103045
between processes. However, you can use TCP/IP.
When your Equinox instance gets information on some port you choose, you
can smoothly shutdown your instance.
You can write data across network connections using Unix "nc" utility.
Snjeza
Paul wrote:
> I'm looking at building a startup/shutdown script to run a headless
> Equinox from "/etc/init.d".
>
> Is there a "nice" way to shutdown the Equinox instance instead of just
> sending a kill?
>
> thx
>]]>Snjezana Peco2007-12-24T19:35:47-00:00Re: Headless Equinox Clean Shutdown?
https://www.eclipse.org/forums/index.php/mv/msg/31771/103058/#msg_103058
Originally posted by: akarypid.yahoo.gr
Actually, even though it is correct you can't add UNIX signal handlers
to Java, it is possible to catch a JVM that is shutting down with:
> Java doesn't support Unix signals or similar mechanism for communication
> between processes. However, you can use TCP/IP.
> When your Equinox instance gets information on some port you choose, you
> can smoothly shutdown your instance.
> You can write data across network connections using Unix "nc" utility.
>
> Snjeza
>
>
> Paul wrote:
>> I'm looking at building a startup/shutdown script to run a headless
>> Equinox from "/etc/init.d".
>>
>> Is there a "nice" way to shutdown the Equinox instance instead of just
>> sending a kill?
>>
>> thx
>>]]>2007-12-25T01:11:13-00:00Re: Headless Equinox Clean Shutdown?
https://www.eclipse.org/forums/index.php/mv/msg/31771/103071/#msg_103071
Originally posted by: akarypid.yahoo.gr
Just in case it wasn't clear: the shutdown hook will execute if you send
a SIGTERM to your application. All you have to do is trigger "clean
shutdown" from within the hook, wait for it to complete and return once
it is "safe" for the JVM to proceed with shutdown.
Alexandros Karypidis wrote:
> Actually, even though it is correct you can't add UNIX signal handlers
> to Java, it is possible to catch a JVM that is shutting down with:
>
> http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html #addShutdownHook(java.lang.Thread)
>
>
> If it's not just a daemon thread but a program that also has an RCP UI,
> you should also take a look at the considerations in this blog:
>
> http://richclientplatform.blogspot.com/2007/09/sigue-sigue-s igterm_12.html
>
> Snjezana Peco wrote:
>
>> Java doesn't support Unix signals or similar mechanism for
>> communication between processes. However, you can use TCP/IP.
>> When your Equinox instance gets information on some port you choose,
>> you can smoothly shutdown your instance.
>> You can write data across network connections using Unix "nc" utility.
>>
>> Snjeza
>>
>>
>> Paul wrote:
>>> I'm looking at building a startup/shutdown script to run a headless
>>> Equinox from "/etc/init.d".
>>>
>>> Is there a "nice" way to shutdown the Equinox instance instead of
>>> just sending a kill?
>>>
>>> thx
>>>]]>2007-12-25T01:14:25-00:00Re: Headless Equinox Clean Shutdown?
https://www.eclipse.org/forums/index.php/mv/msg/31771/103156/#msg_103156
Originally posted by: paule.willcode4beer.com
Thanks, I'm just trying to make sure Jetty can do a proper clean-up on
shutdown. Guess, I'll just emulate the 'ol Tomcat shutdown port :-)]]>2008-01-02T20:26:31-00:00Re: Headless Equinox Clean Shutdown?
https://www.eclipse.org/forums/index.php/mv/msg/31771/103168/#msg_103168
Originally posted by: paule.willcode4beer.com
point taken but, regarding Equniox, is it ok to just kill it?
usually, a platform comes with some means to conduct a clean shutdown.
this makes it look like I'll need to submit a patch to the equinox project
to provide lifecycle methods.]]>2008-01-02T20:35:55-00:00Re: Headless Equinox Clean Shutdown?
https://www.eclipse.org/forums/index.php/mv/msg/31771/103173/#msg_103173
Originally posted by: paule.willcode4beer.com
I forgot to ask, is it ok to just kill Equinox?
Eclipse doesn't seem to like it when you do that.
Is there no hook/command to tell the Equinox platform to shutdown
gracefully?]]>2008-01-02T20:41:56-00:00Re: Headless Equinox Clean Shutdown?
https://www.eclipse.org/forums/index.php/mv/msg/31771/103187/#msg_103187
Originally posted by: paule.willcode4beer.com
Answering my own question.
I've dug through the source a bit and concluded that the simplest thing to
do is to create a start-up class.
This will call the "startup()" method in
'org.eclipse.core.runtime.adaptor.EclipseStarter'. It will then listen on
a port for a shutdown command and (when received), call the "shutdown()"
on the EclipseStarter class.
This should provide a "clean" way to shutdown an Equinox instance. It will
also allow lifecycle events to proceed in the normal way for Equinox and
all bundles that are installed.
I might also, have it re-route the io for the FrameworkConsole in order to
support a remote equinox console.]]>2008-01-02T21:13:12-00:00Headless Startup/Shutdown Scripts
https://www.eclipse.org/forums/index.php/mv/msg/31771/103200/#msg_103200
as well as ensuring that it can perform a clean shutdown.
It's the first revision (read no security, weak error handling) so please
be gentle.
Basically, the concept is to use a bootstrap class to start the service
and keep it running. It listens on a port to receive STATUS and SHUTDOWN
commands.]]>Paul Davis2008-01-04T00:48:41-00:00