If you are specific , your shell scripts do not work at all, and everything works with the first code, then this should be a java command lock or it will not complete correctly using the call() function.
You can verify this by adding dummy file creation to your bash scripts. Put it in the first line of the script, so if it is executed, you will get a dummy file. If it is not created, this means that the scripts were not executed, possibly due to something with java execution.
I would try a couple of things:
First I returned Popen instead of call . Instead of using wait() use communicate() :
Interaction with the process: sending data to stdin. Read data from stdout and stderr until the end of the file is reached. Wait for the process to complete. communicate () returns a tuple (stdoutdata, stderrdata) .
proc = subprocess.Popen(jar_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc.communicate()
Be sure to check both data streams (stdout and stderr). You may skip the error that caused the java process.
Then I tried to disable the buffer by pointing bufsize=0 to Popen . It will eliminate the option related to python buffering.
If both parameters still do not work, try to see if there is an exception using check_call() :
proc = subprocess.check_call(jar_command)
Run the command with arguments. Wait for the command to complete. If the return code was zero, then return, otherwise raise a CalledProcessError.
These parameters may have an answer; if not, they will help in the debugging process. Feel free to comment on how this progress.