users@glassfish.java.net

Re: Automatic restart of DAS/nodeagents

From: <glassfish_at_javadesktop.org>
Date: Mon, 04 Jan 2010 23:19:05 PST

Sorry about not following this up, somehow I missed the notification about your reply.

Ok, just tested this on RHEL 5.

I create this script named start-as-root:

#! /bin/sh
H=/home/o
cd $H/SUNWappserver
exec su -c "$H/SUNWappserver/bin/asadmin start-domain --user admin --passwordfile $H/.auth 2000" o

Then I add this line to /etc/inittab:

gf:3:respawn:/home/o/start-as-root

and tell init to re-read the config using telinit q.

This is what I see in /var/log/messages:

Jan 5 08:08:33 centos init: Re-reading inittab
Jan 5 08:08:55 centos init: Id "gf" respawning too fast: disabled for 5 minutes

The server.log of this appserver has this:

[#|2010-01-05T08:08:44.416+0100|INFO|sun-appserver2.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Application server startup complete.|#]


The Unix behaviour of reparenting orphaned processes to init is not related to init's respawn functionality.


Daemonization with the rc.d scripts is fine, but that doesn't restarted services that stop, AFAIK.

So, without extra elbow-grease to somehow capture the PID of process2, it's not trivial to restart a glassfish jvm. Or you can use --verbose, which is not intended for this.
[Message sent by forum member 'sysprv' (tex_at_tinspoon.net)]

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