summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorsunil unnava <sunil.unnava@att.com>2019-02-07 13:57:01 -0500
committersunil unnava <sunil.unnava@att.com>2019-02-07 13:57:27 -0500
commit2fb7a686abae1fcdd8ae06c8abeb759c2bcfd069 (patch)
tree380a52a64c9ef4e67e1bc7155ed3dea6b71a7f71 /src/main/java
parent82136c1fd201cf815cdd85a0f02e8dd6316d6ec7 (diff)
update the shell script
Issue-ID: DMAAP-909 Change-Id: If2148445006a2c412bec1e42bb9b519b5d5ae527 Signed-off-by: sunil unnava <sunil.unnava@att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/dmaap/mr/dmaapMMAgent/utils/MirrorMakerProcessHandler.java10
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() {