Starting java processes with Upstart

Posted by user265330 on Ask Ubuntu See other posts from Ask Ubuntu or by user265330
Published on 2012-07-12T11:38:37Z Indexed on 2012/09/30 15:50 UTC
Read the original article Hit count: 328

Filed under:
|

I want to start a java process using Upstart. Currently, on our OpenSuSE servers, I use the System V init system to achieve this, but on our Ubuntu servers I'd rather use Upstart. But I have two questions...

I have an Upstart job (a task) that configures the server, called, say, myconfig. And in the job that starts my java processes I ostensibly have:

start on stopped myconfig
exec /path/to/myjavastartscript.sh

myjavastartscript.sh runs 'java -classpath blah MyClass'. In System V init, starting the service runs 'nohup /path/to/myjavastartscript.sh &'.

So my first question is whether I still need to do the nohup or run-in-background with the exec command?

When running, MyClass starts other Java processes. In System V init, the service stop just looks for java processes owned by a certain user and kills them. My second question is how could I control the termination of these processes with Upstart?

© Ask Ubuntu or respective owner

Related posts about java

Related posts about upstart