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.


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to