From 245efd2f57ed2dce49853c9b441f9abe121cded2 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 28 Jun 2005 10:55:59 +0000 Subject: [PATCH] MPV: solution for the problem of kill Salome appllication: it hangs up when tried to kill omniORB process of another user (is started with the same port) --- bin/killSalomeWithPort.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 1ac458083..e3fdea77e 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -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__": -- 2.39.2