You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ace.apache.org by Niclas Hedhman <ni...@hedhman.org> on 2014/09/10 10:47:55 UTC

Adding Shutdown Hook for Agents??

Hi,

A long time ago I was a mentor of this project, and now I am actually using
it in $dayjob application. What goes around, comes around... ;-)

The deployment is happening on Linux 'devices' and we need to support that
the ACE Targets are shutdown via Linux SIGINT (Ctrl-C), i.e. we need a JVM
shutdown hook that do framework.stop(). Fairly simple...

It seems logical that this functionality is part of ACE itself, and I am
adding this at the moment. There are 3 choices on this, and I would
appreciate your thoughts;
  1. The shutdown hook is always present,
  2. It is enabled via command-line arguments,
  3. It is enabled via launcher.properties.

which route should be taken?


I would also like to contribute this back,

  a. I have mostly forgotten how to submit patches with SVN, but recall
that there were often issue with it. Is there a page explaining the exact
details?

  b. We will also make a Linux daemon shell that starts and stops agents,
and in the stop it will both issue the SIGINT and if the process isn't
dying 'soon enough', a SIGKILL will be issued to ensure death and
destruction. Is ACE community interested in making such script part of the
the 'target' ? Or will that forever remain the responsibility of the user
to put together?


Cheers
-- 
Niclas Hedhman, Software Developer
河南南路555弄15号1901室。
http://www.qi4j.org - New Energy for Java

I live here; http://tinyurl.com/3xugrbk
I work here; http://tinyurl.com/6a2pl4j
I relax here; http://tinyurl.com/2cgsug

Re: Adding Shutdown Hook for Agents??

Posted by Marcel Offermans <ma...@luminis.eu>.
Hello Niclas,

On 10 Sep 2014, at 10:47 am, Niclas Hedhman <ni...@hedhman.org> wrote:

> A long time ago I was a mentor of this project, and now I am actually using
> it in $dayjob application. What goes around, comes around... ;-)

Welcome back! :)

> The deployment is happening on Linux 'devices' and we need to support that
> the ACE Targets are shutdown via Linux SIGINT (Ctrl-C), i.e. we need a JVM
> shutdown hook that do framework.stop(). Fairly simple...
> 
> It seems logical that this functionality is part of ACE itself, and I am
> adding this at the moment. There are 3 choices on this, and I would
> appreciate your thoughts;
>  1. The shutdown hook is always present,
>  2. It is enabled via command-line arguments,
>  3. It is enabled via launcher.properties.
> 
> which route should be taken?

I see no reason why we should not always have it present, so unless someone can come up with a good reason not to, I'd say keep it simple and always have this enabled.

> I would also like to contribute this back,
> 
>  a. I have mostly forgotten how to submit patches with SVN, but recall
> that there were often issue with it. Is there a page explaining the exact
> details?

Our page explaining how to submit a patch is rather brief:

http://ace.apache.org/get-involved/issue-tracking.html

I'm sure Google will be able to remind you how to create a patch file. If you attach that to an issue, we can review and apply it.


>  b. We will also make a Linux daemon shell that starts and stops agents,
> and in the stop it will both issue the SIGINT and if the process isn't
> dying 'soon enough', a SIGKILL will be issued to ensure death and
> destruction. Is ACE community interested in making such script part of the
> the 'target' ? Or will that forever remain the responsibility of the user
> to put together?

I'll speak for myself, I think this would be interesting to provide to our users. At the very least it serves as a good example of how to do this.

Greetings, Marcel