diff --git a/process_monitor.py b/process_monitor.py index 11bb847..f5503c1 100644 --- a/process_monitor.py +++ b/process_monitor.py @@ -291,6 +291,8 @@ def pre_send (self, test_number): def start_target (self): """ Start up the target process by issuing the commands in self.start_commands. + + @returns True if successful. No failure detection yet. """ self.log("starting target process") diff --git a/process_monitor_unix.py b/process_monitor_unix.py index 7f33d3b..1ef58cd 100644 --- a/process_monitor_unix.py +++ b/process_monitor_unix.py @@ -4,6 +4,7 @@ import signal import time import threading +import subprocess from sulley import pedrpc @@ -63,7 +64,7 @@ def __init__(self, start_command): def spawn_target(self): print self.tokens - self.pid = os.spawnv(os.P_NOWAIT, self.tokens[0], self.tokens) + self.pid = subprocess.Popen(self.tokens).pid self.alive = True def start_monitoring(self): @@ -172,9 +173,11 @@ def pre_send (self, test_number): self.test_number = test_number def start_target (self): - ''' + """ Start up the target process by issuing the commands in self.start_commands. - ''' + + @returns True if successful. No failure detection yet. + """ self.log("starting target process") @@ -184,6 +187,7 @@ def start_target (self): threading.Thread(target=self.dbg.start_monitoring).start() self.log("done. target up and running, giving it 5 seconds to settle in.") time.sleep(5) + return True def stop_target (self): '''