Tuesday, 17 September 2013

How can i let the BASH script run as process? So that even the Python script is killed the BASH script runs forever?

How can i let the BASH script run as process? So that even the Python
script is killed the BASH script runs forever?

I need to track and launch few BASH scripts as process (if they for some
reason crashed or etc). So i was trying as below: but not working
def ps(self, command):
process = subprocess.Popen(['/bin/bash'], shell=False,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
process.stdin.write(command + '\n')
process.stdout.readline()
ps("/var/tmp/KernelbootRun.sh")
ps("ps aux | grep processCreator.py | awk '{print $2}' | xargs kill -9")
None is working.

No comments:

Post a Comment