We have a project where we’re launching jython server processes under supervisord, which expects the pid of the launched process to respond to term signals for the process. With the Jython bash script, however, it executes Java as a subprocess, but if one attempts to terminate the parent process (a bash process), the child java process does not terminate. This means supervisord cannot manage jython processes.


I found that adding ‘exec’ in the launch of JAVA_CMD (in the jython script) addresses this issue.


I’m guessing that exec can’t be added to the script because it will prevent the subsequent code from running.


What is the recommended solution for a case like this? Should we generate the java command line and invoke it directly? Should we patch the jython script with ‘exec’? Or should the jython script support a mode where this isn’t an issue?


My preference would be for the latter (with perhaps special scripts to handle the cases where invoking java using exec is not desired).


In any case, thanks for the tips.