diff options
author | varun gudisena <varuneshwar.gudisena@att.com> | 2019-02-07 20:26:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-02-07 20:26:26 +0000 |
commit | 89fd34e909a6864f568ffb76218e8903144c88cd (patch) | |
tree | 99ed925a7fa58af10e50ec0c2a596c653e73cb2c /src/main/java | |
parent | 29b48a164bae4ce42df5c2cc6df4d062bf47e1cb (diff) | |
parent | 2fb7a686abae1fcdd8ae06c8abeb759c2bcfd069 (diff) |
Merge "update the shell script"
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/dmaap/mr/dmaapMMAgent/utils/MirrorMakerProcessHandler.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/onap/dmaap/mr/dmaapMMAgent/utils/MirrorMakerProcessHandler.java b/src/main/java/org/onap/dmaap/mr/dmaapMMAgent/utils/MirrorMakerProcessHandler.java index 9fe80db..114d1f8 100644 --- a/src/main/java/org/onap/dmaap/mr/dmaapMMAgent/utils/MirrorMakerProcessHandler.java +++ b/src/main/java/org/onap/dmaap/mr/dmaapMMAgent/utils/MirrorMakerProcessHandler.java @@ -45,7 +45,7 @@ public class MirrorMakerProcessHandler { } else { //String args[] = { "/bin/sh", "-c", "ps -ef |grep java |grep agentname=" + agentname + "~" }; - String args[] = { "/bin/sh", "-c", "ps -ef | grep `ps -ef |grep agentname=" + agentname + "~ | egrep -v 'grep|java' | awk '{print $2}' `| egrep -v '/bin/sh|grep' "}; + String args[] = { "/bin/sh", "-c", "ps -ef |grep agentname=" + agentname + "| grep -v grep | awk '{print $1}'"}; logger.info("CheckMM process->"+args[2]); mmprocess = rt.exec(args); } @@ -118,7 +118,7 @@ public class MirrorMakerProcessHandler { //String args[] = { "/bin/sh", "-c", // "kill -9 `ps -ef |grep agentname=" + agentname + "~| egrep -v 'grep|java' | awk '{print $2}'` | egrep -v '/bin/sh|grep'"}; String args[] = { "/bin/sh", "-c", - "for i in `ps -ef |grep agentname="+ agentname + "~ | egrep -v 'grep|java' | awk '{print $2}'`;do kill -9 `ps -eaf | grep $i | egrep -v '/bin/sh|grep' | awk '{print $2}'` ;done"}; + "kill -9 $(ps -ef | grep agentname=" + agentname + "| grep -v grep | awk '{print $1}')"}; logger.info ("Stop MM ->"+args[2]); // args = "kill $(ps -ef |grep java |grep agentname=" + // agentname + "~| awk '{print $2}')"; @@ -170,9 +170,9 @@ public class MirrorMakerProcessHandler { } else { String args[] = { "/bin/sh", "-c", kafkaHome + "/bin/kafka-run-class.sh -Dagentname=" + agentName - + "~ kafka.tools.MirrorMaker --consumer.config " + consumerConfig - + " --producer.config " + producerConfig + " --num.streams " + numStreams + " --abort.on.send.failure true" + " --whitelist '" + whitelist + "' >" - + mmagenthome + "/logs/" + agentName + "_MMaker.log 2>&1" }; + + " kafka.tools.MirrorMaker --consumer.config " + consumerConfig + + " --producer.config " + producerConfig + " --num.streams " + numStreams + " --abort.on.send.failure true" + " --whitelist '" + whitelist + "' 2>&1 >" + + mmagenthome + "/logs/" + agentName + "_MMaker.log " }; final Process process = rt.exec(args); new Thread() { public void run() { |