From 7911eb03dbe3f2616edf8b4accd9dcb1d6eef3d7 Mon Sep 17 00:00:00 2001 From: Keisuke Kubota <40480197+kubosuke@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:12:15 +0900 Subject: [PATCH] ISSUE #11212 (#11213) * Use pgrep in shutdown.sh * Fix dot --- distribution/bin/shutdown.sh | 2 +- distribution/bin/startup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/distribution/bin/shutdown.sh b/distribution/bin/shutdown.sh index e3e14fedd86..5394e60be31 100644 --- a/distribution/bin/shutdown.sh +++ b/distribution/bin/shutdown.sh @@ -15,7 +15,7 @@ cd `dirname $0`/../target target_dir=`pwd` -pid=`ps ax | grep -i 'nacos.nacos' | grep ${target_dir} | grep java | grep -v grep | awk '{print $1}'` +pid=`pgrep -f nacos.nacos` if [ -z "$pid" ] ; then echo "No nacosServer running." exit -1; diff --git a/distribution/bin/startup.sh b/distribution/bin/startup.sh index 3786cf405ad..93027748dfe 100644 --- a/distribution/bin/startup.sh +++ b/distribution/bin/startup.sh @@ -146,4 +146,4 @@ else nohup "$JAVA" "$JAVA_OPT_EXT_FIX" ${JAVA_OPT} nacos.nacos >> ${BASE_DIR}/logs/start.out 2>&1 & fi -echo "nacos is starting,you can check the ${BASE_DIR}/logs/start.out" +echo "nacos is starting. you can check the ${BASE_DIR}/logs/start.out"