X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fapplication.py;h=727375d6f9f3a69ee457fe1d47f2ee625de50660;hb=eb16e40f7b5b7e4aa71c9a1d5ebdf348bcbebb21;hp=13a8a9b969d6ebcf74f94a7f47cd5beb76eedd1c;hpb=13d6810d392f5b38489c5e188d46eb5e41258fe9;p=nepi.git diff --git a/src/nepi/resources/linux/application.py b/src/nepi/resources/linux/application.py index 13a8a9b9..727375d6 100644 --- a/src/nepi/resources/linux/application.py +++ b/src/nepi/resources/linux/application.py @@ -447,27 +447,26 @@ class LinuxApplication(ResourceManager): # check if execution errors occurred msg = " Failed to start command '%s' " % command - if proc.poll() and err: + if proc.poll(): self.error(msg, out, err) raise RuntimeError, msg - # Check status of process running in background + # Wait for pid file to be generated pid, ppid = self.node.wait_pid(self.app_home) if pid: self._pid = int(pid) if ppid: self._ppid = int(ppid) - + # If the process is not running, check for error information # on the remote machine if not self.pid or not self.ppid: - (out, err), proc = self.node.check_output(self.app_home, 'stderr') - self.error(msg, out, err) + (out, err), proc = self.check_errors(home, ecodefile, stderr) - msg2 = " Setting state to Failed" - self.debug(msg2) - self._state = ResourceState.FAILED + # Out is what was written in the stderr file + if err: + msg = " Failed to start command '%s' " % command + self.error(msg, out, err) + raise RuntimeError, msg - raise RuntimeError, msg - super(LinuxApplication, self).start() else: