summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
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/org
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/org')
-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() {
ng.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */