[tuxdroid-svn] r5117 - software_suite_v3/smart-core/smart-server/trunk/util/smartcore
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-07-15 12:35:45
|
Author: remi
Date: 2009-07-15 14:35:32 +0200 (Wed, 15 Jul 2009)
New Revision: 5117
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/smartcore/OldProcessKiller.py
Log:
* Added function to kill previous children instances on Linux.
Modified: software_suite_v3/smart-core/smart-server/trunk/util/smartcore/OldProcessKiller.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/smartcore/OldProcessKiller.py 2009-07-15 12:10:59 UTC (rev 5116)
+++ software_suite_v3/smart-core/smart-server/trunk/util/smartcore/OldProcessKiller.py 2009-07-15 12:35:32 UTC (rev 5117)
@@ -122,7 +122,25 @@
def __killOldSmartCoreChildrenUnix():
"""Kill all process alive from a previous instance of smart-core. Unix.
"""
- pass
+ processInfosList = __getProcessIdNameCmdLineListUnix()
+ pidToKill = []
+ for e in processInfosList:
+ pid = e[0]
+ name = e[1]
+ cmdline = e[2]
+ if name.lower().find("python") != -1:
+ if cmdline.lower().find("executables") != -1:
+ pidToKill.append(pid)
+ continue
+ if cmdline.lower().find("workforplugins") != -1:
+ pidToKill.append(pid)
+ continue
+ if (cmdline.lower().find("tuxdroid") != -1) and \
+ (cmdline.lower().find("util") != -1):
+ pidToKill.append(pid)
+ continue
+ for pid in pidToKill:
+ os.system("kill -9 " + str(pid))
# ------------------------------------------------------------------------------
# Kill previous smart-server. Unix.
|