Starting java processes with Upstart
- by user265330
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?