users@glassfish.java.net

Re: Automatic restart of DAS/nodeagents

From: <glassfish_at_javadesktop.org>
Date: Fri, 25 Sep 2009 14:38:39 PDT

> Hi!
>
> The GlassFish Enterprise 2.1 Administration Guide
> (http://docs.sun.com/app/docs/doc/820-4335/ablwy?a=vie
> w) says that on Linux the DAS or nodeagents can be
> restarted by using the respawn functionality of
> /sbin/init.
> But, once a DAS or nodeagent is up and running, the
> asadmin command ends, doesn't it? Wouldn't init then
> run asadmin again, because of the respawn flag?

Yes. But isn't that what you want? In other words, Linux provides the daemonization of the server processes. I haven't done it myself, but it should be possible using init.d.
Here's how asadmin start-domain/node-agent works:
- asadmin start-domain calls a JVM (process1)
- process1 then does some heavy lifting and spawns (exec's) another process which is your real DAS/node-agent process (process2)
- unless specified otherwise, when process1 dies after process2 is exec'ed effectively making the init process the parent of process2. You can see this using the ps command.

So, I am assuming that when the /sbin/init identifies that process2 has died, it should redo the asadmin start-domain/start-node-agent command giving the domain/node-agent a rebirth.

> Is there some way to make the asadmin
> start-domain/start-node-agent to end only when the
> server/nodeagent ends?

Yes, try --verbose, and that will still do the same (as above) in v2, only that it will fill up your logs.

Hope that helps.

-Kedar
[Message sent by forum member 'km' (kedar.mhaswade_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=365788