1
This commit is contained in:
parent
6b9a0b7efa
commit
251bb50cb2
@ -7,7 +7,7 @@ import time
|
||||
|
||||
def getRuningProgramPids(jar_name):
|
||||
pids = []
|
||||
lines = os.popen('ps -ef |grep java|grep %s' % jar_name).readlines()
|
||||
lines = os.popen('ps -ef |grep java|grep %s|grep -v grep' % jar_name).readlines()
|
||||
for l in lines:
|
||||
line = ''
|
||||
oldc = ''
|
||||
@ -17,9 +17,7 @@ def getRuningProgramPids(jar_name):
|
||||
oldc = c
|
||||
line += c
|
||||
line = line.split(' ')
|
||||
|
||||
if line[7] == './%s' % jar_name:
|
||||
pids.append(line[1])
|
||||
pids.append(line[1])
|
||||
return pids
|
||||
|
||||
def getExePath(pid):
|
||||
@ -33,7 +31,7 @@ def stop(instance_id, jar_name):
|
||||
for pid in pids:
|
||||
exepath = getExePath(pid)
|
||||
cmdline = getExeCmdLine(pid)
|
||||
if cmdline.find('-Dinstance_id=%d ' % instance_id) != -1:
|
||||
if cmdline.find('-Dinstance_id=%d\0' % instance_id) != -1:
|
||||
os.popen('kill -9 %d' % int(pid))
|
||||
|
||||
def listServer(jar_name):
|
||||
|
Loading…
x
Reference in New Issue
Block a user