From 78f8b2d17357f0e9ea05bd003a9e9ec97e0e5f38 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 9 Jul 2008 04:44:48 +0000 Subject: [PATCH] Issue 0019872: fix pb of killing SALOME processes (files in /tmp/logs/${USER} directory are removed unconditionally). --- bin/killSalome.py | 26 ++++++++++++-------------- bin/nameserver.py | 2 +- bin/runNS.py | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/bin/killSalome.py b/bin/killSalome.py index 722fd31c7..ed9164cf5 100755 --- a/bin/killSalome.py +++ b/bin/killSalome.py @@ -33,26 +33,24 @@ def killAllPorts(): dirpidict = os.path.dirname(fpidict) fpidict = os.path.basename(fpidict) fnamere = re.compile("^%s$" % fpidict) - try: - for f in os.listdir(dirpidict): - mo = fnamere.match(f) - if mo: killMyPort(mo.group(1)) - pass - pass - except: + for f in os.listdir(dirpidict): + mo = fnamere.match(f) + try: + killMyPort(mo.group(1)) + except: + pass pass # provide compatibility with old-style pidict file (not dot-prefixed) fpidict = getPiDict('(\d*)',hidden=False) dirpidict = os.path.dirname(fpidict) fpidict = os.path.basename(fpidict) fnamere = re.compile("^%s$" % fpidict) - try: - for f in os.listdir(dirpidict): - mo = fnamere.match(f) - if mo: killMyPort(mo.group(1)) - pass - pass - except: + for f in os.listdir(dirpidict): + mo = fnamere.match(f) + try: + killMyPort(mo.group(1)) + except: + pass pass # kill other processes if sys.platform != 'win32': diff --git a/bin/nameserver.py b/bin/nameserver.py index 8c039b1c5..99ec4c3b2 100755 --- a/bin/nameserver.py +++ b/bin/nameserver.py @@ -46,7 +46,7 @@ class NamingServer(Server): #os.system("touch " + upath + "/dummy") for fname in os.listdir(upath): try: - os.remove(upath + "/" + fname) + if not fname.startswith("."): os.remove(upath + "/" + fname) except: pass #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log") diff --git a/bin/runNS.py b/bin/runNS.py index 444760369..601c7b00d 100755 --- a/bin/runNS.py +++ b/bin/runNS.py @@ -39,7 +39,7 @@ def startOmni(): #os.system("touch " + upath + "/dummy") for fname in os.listdir(upath): try: - os.remove(upath + "/" + fname) + if not fname.startswith("."): os.remove(upath + "/" + fname) except: pass #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log") -- 2.39.2