1
This commit is contained in:
parent
1680f0d93b
commit
3000749b53
@ -33,7 +33,7 @@ def stop(instance_id, jar_name):
|
||||
for pid in pids:
|
||||
exepath = getExePath(pid)
|
||||
cmdline = getExeCmdLine(pid)
|
||||
if cmdline == ("./%s\0-i\0%d\0-n\0%d\0" % (jar_name, instance_id, node_id)):
|
||||
if cmdline.find('-Dinstance_id="%s"' % instance_id) != -1:
|
||||
os.popen('kill -9 %d' % int(pid))
|
||||
|
||||
def listServer(jar_name):
|
||||
@ -50,12 +50,12 @@ def restartServer(str_instance_ids, jar_name):
|
||||
stop(instance_id, jar_name)
|
||||
time.sleep(0.5)
|
||||
print('%s %d starting......' % (jar_name, instance_id))
|
||||
cmd = 'sh start_instance.sh %d %d' % (instance_id)
|
||||
cmd = 'sh start_instance.sh %d' % (instance_id)
|
||||
os.popen(cmd)
|
||||
time.sleep(0.5)
|
||||
|
||||
def printHelp():
|
||||
print('usuage: [restart stop list]')
|
||||
print('usuage: [restart list]')
|
||||
|
||||
def main(argv):
|
||||
if len(argv) == 1:
|
||||
|
7
scripts/publish_java/start_instance.sh
Executable file
7
scripts/publish_java/start_instance.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./common.sh
|
||||
|
||||
mkdir -p logs
|
||||
|
||||
java -jar ${JAVA_OPTS} -Dinstance_id="$1" -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlog4j.configurationFile=${LOG4J2_FILE} ${JAR_NAME} >> logs/app_$1.out 2>&1 &
|
Loading…
x
Reference in New Issue
Block a user