I'm running a Python script from my NGINX server that runs this command
subprocess.call(["sh", "/runscript.sh", arg1, arg2, arg3], shell=False)
Problem is that when my server kill the script execution, the subprocess runned can't stop, just run forever.
That's a huge problem.
Already tried to change shell=True/shell=False.
EDIT I've implemented the code inside the sh script inside the python script. So now process start directly from subprocess.call.
There is a ways to save the PID of processes started from subprocess.call and end when task does not have input?