i've just created a software in python which should schedule several commands from shell. (ps: i'm working on linux) By the way, i've created the following function to launch processes:
def exec_command(cmd):
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid)
pid = process.pid
print '----------launched process with PID: ', pid
return pid
After this i use the pid to check if the process goes on zombie's state and in that case a kill it.
Sometime everything works just fine but there is a case in which the process launched doesn't do anything.
The process i'm talking about is: sh /home/ubuntu/programs/data-integration/kitchen.sh -file=/home/ubuntu/TrasformazioneAVM/JobAVM.kjb -level=Basic -param:processName=avm
If i launch it by shell everything works perfectly but if i do it with my function i can see the process on the system monitor (or by shell with the "top" command) but nothing appens (i check the memory usage and cpu usage which is usually really high but not in this case).
Any body has any ideas ?