This is an automated email from the ASF dual-hosted git repository.
zhangyonglun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 1e887eb fix: shell error (#2859)
1e887eb is described below
commit 1e887eb53b91d1bcb5018324e8cc42a586cb63c1
Author: lahm xu <[email protected]>
AuthorDate: Thu Feb 10 15:31:55 2022 +0800
fix: shell error (#2859)
---
.../apache/shenyu/admin/config/RegisterCenterConfiguration.java | 2 +-
.../shenyu/admin/controller/ShenyuHttpRegistryController.java | 7 ++++++-
shenyu-dist/shenyu-admin-dist/src/main/resources/bin/start.sh | 7 -------
shenyu-dist/shenyu-admin-dist/src/main/resources/bin/stop.sh | 2 +-
shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/start.sh | 7 -------
shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/stop.sh | 2 +-
6 files changed, 9 insertions(+), 18 deletions(-)
diff --git
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/RegisterCenterConfiguration.java
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/RegisterCenterConfiguration.java
index e34fa6e..fb44135 100644
---
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/RegisterCenterConfiguration.java
+++
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/RegisterCenterConfiguration.java
@@ -54,7 +54,7 @@ public class RegisterCenterConfiguration {
* @param shenyuClientRegisterService the shenyu client register service
* @return the shenyu server register repository
*/
- @Bean
+ @Bean(destroyMethod = "close")
public ShenyuServerRegisterRepository shenyuServerRegisterRepository(final
ShenyuRegisterCenterConfig shenyuRegisterCenterConfig,
final
List<ShenyuClientRegisterService> shenyuClientRegisterService) {
String registerType = shenyuRegisterCenterConfig.getRegisterType();
diff --git
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuHttpRegistryController.java
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuHttpRegistryController.java
index 52fce14..25934a3 100644
---
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuHttpRegistryController.java
+++
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuHttpRegistryController.java
@@ -44,7 +44,12 @@ public class ShenyuHttpRegistryController implements
ShenyuServerRegisterReposit
public void init(final ShenyuServerRegisterPublisher publisher, final
ShenyuRegisterCenterConfig config) {
this.publisher = publisher;
}
-
+
+ @Override
+ public void close() {
+ publisher.close();
+ }
+
/**
* Register metadata string.
*
diff --git a/shenyu-dist/shenyu-admin-dist/src/main/resources/bin/start.sh
b/shenyu-dist/shenyu-admin-dist/src/main/resources/bin/start.sh
index 4dfd89f..5a920bd 100644
--- a/shenyu-dist/shenyu-admin-dist/src/main/resources/bin/start.sh
+++ b/shenyu-dist/shenyu-admin-dist/src/main/resources/bin/start.sh
@@ -30,13 +30,6 @@ fi
LOG_FILES=${LOGS_DIR}/shenyu-admin.log
EXT_LIB=${DEPLOY_DIR}/ext-lib
-PIDS=`ps -ef | grep "$DEPLOY_DIR" | grep -v grep | pgrep -f java`
-if [ -n "$PIDS" ]; then
- echo "ERROR: The $SERVER_NAME already started!"
- echo "PID: $PIDS"
- exit 1
-fi
-
CLASS_PATH=.:${DEPLOY_DIR}/conf:${DEPLOY_DIR}/lib/*:${EXT_LIB}/*
JAVA_OPTS=" -server -Xmx2g -Xms2g -Xmn1g -Xss256k -XX:+DisableExplicitGC
-XX:LargePageSizeInBytes=128m"
diff --git a/shenyu-dist/shenyu-admin-dist/src/main/resources/bin/stop.sh
b/shenyu-dist/shenyu-admin-dist/src/main/resources/bin/stop.sh
index e86e35f..b73da86 100644
--- a/shenyu-dist/shenyu-admin-dist/src/main/resources/bin/stop.sh
+++ b/shenyu-dist/shenyu-admin-dist/src/main/resources/bin/stop.sh
@@ -22,7 +22,7 @@ cd `dirname $0`
cd ..
DEPLOY_DIR=`pwd`
-PIDS=`ps -ef | grep "$DEPLOY_DIR" | grep -v grep | pgrep -f java`
+PIDS=`ps -eo pid,cmd |grep -v tail|grep -v grep|grep "$DEPLOY_DIR"|awk '{print
$1}'`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1
diff --git a/shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/start.sh
b/shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/start.sh
index 2fa18e6..44e8b88 100644
--- a/shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/start.sh
+++ b/shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/start.sh
@@ -30,13 +30,6 @@ fi
LOG_FILES=${LOGS_DIR}/shenyu-bootstrap.log
EXT_LIB=${DEPLOY_DIR}/ext-lib
-PIDS=`ps -ef | grep "$DEPLOY_DIR" | grep -v grep | pgrep -f java`
-if [ -n "$PIDS" ]; then
- echo "ERROR: The $SERVER_NAME already started!"
- echo "PID: $PIDS"
- exit 1
-fi
-
CLASS_PATH=.:${DEPLOY_DIR}/conf:${DEPLOY_DIR}/lib/*:${EXT_LIB}/*
JAVA_OPTS=" -server -Xmx2g -Xms2g -Xmn1g -Xss512k -XX:+DisableExplicitGC
-XX:LargePageSizeInBytes=128m"
diff --git a/shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/stop.sh
b/shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/stop.sh
index 73599d2..ca02bdd 100644
--- a/shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/stop.sh
+++ b/shenyu-dist/shenyu-bootstrap-dist/src/main/resources/bin/stop.sh
@@ -22,7 +22,7 @@ cd `dirname $0`
cd ..
DEPLOY_DIR=`pwd`
-PIDS=`ps -ef | grep "$DEPLOY_DIR" | grep -v grep | pgrep -f java`
+PIDS=`ps -eo pid,cmd |grep -v tail|grep -v grep|grep "$DEPLOY_DIR"|awk '{print
$1}'`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1