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