From: Lucia Guevgeozian Odizzio Date: Thu, 30 Jan 2014 14:41:24 +0000 (+0100) Subject: Adding process snapshot before running command X-Git-Tag: nepi-3.1.0~136^2~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f041619b28edd399778b355546dd6606dfeb39e7;p=nepi.git Adding process snapshot before running command --- diff --git a/src/nepi/resources/linux/application.py b/src/nepi/resources/linux/application.py index 5ae8f0b3..db92fecf 100644 --- a/src/nepi/resources/linux/application.py +++ b/src/nepi/resources/linux/application.py @@ -187,7 +187,7 @@ class LinuxApplication(ResourceManager): # timestamp of last state check of the application self._last_state_check = tnow() - + def log_message(self, msg): return " guid %d - host %s - %s " % (self.guid, self.node.get("hostname"), msg) @@ -271,6 +271,13 @@ class LinuxApplication(ResourceManager): return out def do_provision(self): + # take a snapshot of the system if user is root + # to assure cleanProcess kill every nepi process + if self.node.get("username") == 'root': + ps_aux = "ps aux |awk '{print $2}' |sort -u" + (out, err), proc = self.node.execute(ps_aux) + self.node._pids = out.split() + # create run dir for application self.node.mkdir(self.run_home)