]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
MPV: solution for the problem of kill Salome appllication: it hangs up when tried...
authormpv <mpv@opencascade.com>
Tue, 28 Jun 2005 10:55:59 +0000 (10:55 +0000)
committermpv <mpv@opencascade.com>
Tue, 28 Jun 2005 10:55:59 +0000 (10:55 +0000)
bin/killSalomeWithPort.py

index 1ac4580832f6f094e7eccfb8aa864544403c5a0a..e3fdea77e4dd30fd4ce8ccfce693f83375a3671b 100755 (executable)
@@ -31,9 +31,11 @@ def killMyPort(port):
             pass
         os.remove(filedict)
         pid = commands.getoutput("ps -eo pid,command | egrep \"[0-9] omniNames -start "+str(port)+"\" | sed -e \"s%[^0-9]*\([0-9]*\) .*%\\1%g\"")
-        while pid != "":
-            a = os.system("pid=`ps -eo pid,command | egrep \"[0-9] omniNames -start "+str(port)+"\" | sed -e \"s%[^0-9]*\([0-9]*\) .*%\\1%g\"`; kill -9 $pid")
+       a = ""
+        while pid != "" and len(a.split(" ")) < 2:
+            a = commands.getoutput("pid=`ps -eo pid,command | egrep \"[0-9] omniNames -start "+str(port)+"\" | sed -e \"s%[^0-9]*\([0-9]*\) .*%\\1%g\"`; kill -9 $pid")
             pid = commands.getoutput("ps -eo pid,command | egrep \"[0-9] omniNames -start "+str(port)+"\" | sed -e \"s%[^0-9]*\([0-9]*\) .*%\\1%g\"")
+           print pid
               
 
 if __name__ == "__main__":