RE: Shutting down Jigsaw server without JigAdmin

Thanks for the reply.

I find your solution valuable.  I didn't realize what the shutdown hook was doing, though I saw it in the code.

Unfortunately, this puts us into a bind.  We're running our JVM with the -Xrs option, which (I believe) disables the shutdown capability.  The reason we were using -Xrs was because JAVA/Jigsaw would absorb any SIGINTR (ctrl-c) that the user would generate.  This would shutdown Jigsaw, but leave our JNI based daemon unaware of the shutdown.  So by fixing the one problem, we re-introduce another.

At this point, IMHO, I still see the JNI Killer server as the best alternative.

> -----Original Message-----
> From: Yves Lafon [mailto:ylafon@w3.org]
> Sent: Friday, January 03, 2003 5:37 PM
> To: Wayne Johnson
> Cc: www-jigsaw@w3.org
> Subject: Re: Shutting down Jigsaw server without JigAdmin
> 
> 
> On Fri, 3 Jan 2003, Wayne Johnson wrote:
> 
> >
> > We are using a somewhat stripped down version of Jigsaw 
> that does not
> > run the jigadmin (8009) port for security and other reasons.  This
> > server runs in a JNI environment.  We need to shutdown the 
> Jigsaw Server
> > before shutting down the JVM, but without a JigAdmin, we can't use
> > JigKill.
> 
> > I propose to write a very stripped down Jigsaw server that:
> > 1) in the initialization method, saves the reference to the 
> shm in a class global,
> > 2) modify server.props to start our service,
> > 3) has a public static method that takes this shm reference 
> and calls its shutdown method,
> > 4) Modify our JNI code to call this public static method at 
> shutdown.
> 
> jdk1.3 an onward has the possibility to catch some signals, using the
> shutdown hook [1]. If your JNI code is able to send such 
> signal to the jvm
> process, then Jigsaw will save its configuration and exit.
> Is it enough for your need?
> Regards,
> 
> [1] 
> http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html#a
ddShutdownHook(java.lang.Thread)

-- 
Yves Lafon - W3C
"Baroula que barouleras, au tiéu toujou t'entourneras."

Received on Monday, 6 January 2003 10:10:25 UTC