[tuxdroid-svn] r5115 - software_suite_v3/smart-core/smart-server/trunk/util/smartcore
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-07-15 11:52:02
|
Author: remi
Date: 2009-07-15 13:51:57 +0200 (Wed, 15 Jul 2009)
New Revision: 5115
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/smartcore/OldProcessKiller.py
Log:
* Added function to kill previous smart-server 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 11:16:31 UTC (rev 5114)
+++ software_suite_v3/smart-core/smart-server/trunk/util/smartcore/OldProcessKiller.py 2009-07-15 11:51:57 UTC (rev 5115)
@@ -130,7 +130,19 @@
def __killPreviousSmartServerUnix():
"""Kill previous smart-server. 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("tuxhttpserver") != -1:
+ if cmdline.lower().find("start") != -1:
+ if pid != os.getpid():
+ pidToKill.append(pid)
+ for pid in pidToKill:
+ os.system("kill -3 -15 -9 " + str(pid))
# ------------------------------------------------------------------------------
# Kill all process alive from a previous instance of smart-core.
|