diff --git a/bin/kafka-server-stop.sh b/bin/kafka-server-stop.sh index de263797916c0..1e5de0ebb00b3 100755 --- a/bin/kafka-server-stop.sh +++ b/bin/kafka-server-stop.sh @@ -14,7 +14,15 @@ # See the License for the specific language governing permissions and # limitations under the License. SIGNAL=${SIGNAL:-TERM} -PIDS=$(ps ax | grep -i 'kafka\.Kafka' | grep java | grep -v grep | awk '{print $1}') + +if [[ $(uname -s) == "OS/390" ]]; then + if [ -z $JOBNAME ]; then + JOBNAME="KAFKSTRT" + fi + PIDS=$(ps -A -o pid,jobname,comm | grep -i $JOBNAME | grep java | grep -v grep | awk '{print $1}') +else + PIDS=$(ps ax | grep -i 'kafka\.Kafka' | grep java | grep -v grep | awk '{print $1}') +fi if [ -z "$PIDS" ]; then echo "No kafka server to stop" diff --git a/bin/zookeeper-server-stop.sh b/bin/zookeeper-server-stop.sh index dcaa325a34a65..324da4123bf2e 100755 --- a/bin/zookeeper-server-stop.sh +++ b/bin/zookeeper-server-stop.sh @@ -14,7 +14,15 @@ # See the License for the specific language governing permissions and # limitations under the License. SIGNAL=${SIGNAL:-TERM} -PIDS=$(ps ax | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}') + +if [[ $(uname -s) == "OS/390" ]]; then + if [ -z $JOBNAME ]; then + JOBNAME="ZKEESTRT" + fi + PIDS=$(ps -A -o pid,jobname,comm | grep -i $JOBNAME | grep java | grep -v grep | awk '{print $1}') +else + PIDS=$(ps ax | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}') +fi if [ -z "$PIDS" ]; then echo "No zookeeper server to stop"