We use daemontools to "monitor" the java process. If the pid somehow
disappears (jvm crashes), daemontoosl will simply restart it, giving it a
new "clean execution environment" (as daemontools' website states-. This is
working fine because our java apps are stateless.

http://cr.yp.to/daemontools.html

<http://cr.yp.to/daemontools.html>I rather like the daemontools approach,
which I find the best I have encounter up until now (not the best in the
world, just the best I know of - I'm actually quite interested by what we'll
come out of this thread).

On 1 February 2011 17:01, Carl Jokl <[email protected]> wrote:

> I am wondering with the different experience different individuals
> have here if anyone has a preferred strategy to run a Java based
> server app in the background on a server.
>
> It is something I can do but probably not in the most elegant way.
> I.e. I can run the Java app with the & operator and then kill it. That
> does not allow it to close down cleanly though. The Java application
> can be stopped by issuing the quit command after running it (i.e. the
> Java application reads from the console looking for the quit command
> to terminate it).
>
> When searching for articles about running a Java app as a Unix service
> I found that there are some native wrappers available. Not having ever
> used any of them I really don't know if these are any good or if there
> is another preferred way of doing what I am doing.
>
> I know a bit about Linux native services at least conceptually from
> the background reading I have been doing for this task. As I
> understand it that normally Linux service will spawn a child process
> for the main service logic and the launching process will exit or
> something on those lines.
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<javaposse%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>
>


-- 
Romain PELISSE,
*"The trouble with having an open mind, of course, is that people will
insist on coming along and trying to put things in it" -- Terry Pratchett*
http://belaran.eu/wordpress/belaran

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to