RE: Shutting down Jigsaw server without JigAdmin

"Wayne Johnson" <[email protected]> Mon, 6 Jan 2003 09:10:21 -0600
Newsgroups gmane.comp.web.jigsaw
Message-ID <A14F6A96A4696D468FBF4256637CBAA8417FED@MAILSERVERMN.mqsoftware.com>
Thanks for the reply.

I find your solution valuable.  I didn't realize what the shutdown hook w=
as 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 rea=
son we were using -Xrs was because JAVA/Jigsaw would absorb any SIGINTR (=
ctrl-c) that the user would generate.  This would shutdown Jigsaw, but le=
ave our JNI based daemon unaware of the shutdown.  So by fixing the one p=
roblem, we re-introduce another.

At this point, IMHO, I still see the JNI Killer server as the best altern=
ative.

> -----Original Message-----
> From: Yves Lafon [mailto:[email protected]]
> Sent: Friday, January 03, 2003 5:37 PM
> To: Wayne Johnson
> Cc: [email protected]
> Subject: Re: Shutting down Jigsaw server without JigAdmin
>=20
>=20
> On Fri, 3 Jan 2003, Wayne Johnson wrote:
>=20
> >
> > We are using a somewhat stripped down version of Jigsaw=20
> 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=20
> Jigsaw Server
> > before shutting down the JVM, but without a JigAdmin, we can't use
> > JigKill.
>=20
> > I propose to write a very stripped down Jigsaw server that:
> > 1) in the initialization method, saves the reference to the=20
> shm in a class global,
> > 2) modify server.props to start our service,
> > 3) has a public static method that takes this shm reference=20
> and calls its shutdown method,
> > 4) Modify our JNI code to call this public static method at=20
> shutdown.
>=20
> 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=20
> signal to the jvm
> process, then Jigsaw will save its configuration and exit.
> Is it enough for your need?
> Regards,
>=20
> [1]=20
> http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html#a
ddShutdownHook(java.lang.Thread)

--=20
Yves Lafon - W3C
"Baroula que barouleras, au ti=E9u toujou t'entourneras."