This is an automated email from the ASF dual-hosted git repository.
zhaoqingran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/master by this push:
new febc91163 [improve] modify bin shells (#2723)
febc91163 is described below
commit febc911639a2692791faac5b0f4bef57195bba83
Author: aias00 <[email protected]>
AuthorDate: Thu Sep 19 16:07:39 2024 +0800
[improve] modify bin shells (#2723)
---
script/assembly/collector/assembly-linux-amd64.xml | 2 +-
script/assembly/collector/assembly-linux-arm64.xml | 2 +-
script/assembly/collector/assembly-macos-amd64.xml | 2 +-
script/assembly/collector/assembly-macos-arm64.xml | 2 +-
script/assembly/collector/assembly-windows-64.xml | 2 +-
script/assembly/collector/assembly.xml | 2 +-
script/assembly/collector/bin/entrypoint.sh | 8 +++++---
script/assembly/collector/bin/restart.sh | 13 +++++++++++--
script/assembly/collector/bin/shutdown.bat | 6 +++---
script/assembly/collector/bin/shutdown.sh | 4 ++--
script/assembly/collector/bin/startup.bat | 8 +++++---
script/assembly/collector/bin/startup.sh | 8 +++++---
script/assembly/server/assembly-linux-amd64.xml | 2 +-
script/assembly/server/assembly-linux-arm64.xml | 2 +-
script/assembly/server/assembly-macos-amd64.xml | 2 +-
script/assembly/server/assembly-macos-arm64.xml | 2 +-
script/assembly/server/assembly-windows-64.xml | 2 +-
script/assembly/server/assembly.xml | 2 +-
script/assembly/server/bin/entrypoint.sh | 8 +++++---
script/assembly/server/bin/restart.sh | 13 +++++++++++--
script/assembly/server/bin/shutdown.bat | 6 +++---
script/assembly/server/bin/shutdown.sh | 4 ++--
script/assembly/server/bin/startup.bat | 8 +++++---
script/assembly/server/bin/startup.sh | 8 +++++---
24 files changed, 74 insertions(+), 44 deletions(-)
diff --git a/script/assembly/collector/assembly-linux-amd64.xml
b/script/assembly/collector/assembly-linux-amd64.xml
index 9d230f12d..f90c97b57 100644
--- a/script/assembly/collector/assembly-linux-amd64.xml
+++ b/script/assembly/collector/assembly-linux-amd64.xml
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/collector/assembly-linux-arm64.xml
b/script/assembly/collector/assembly-linux-arm64.xml
index 900f827b2..b93341f23 100644
--- a/script/assembly/collector/assembly-linux-arm64.xml
+++ b/script/assembly/collector/assembly-linux-arm64.xml
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/collector/assembly-macos-amd64.xml
b/script/assembly/collector/assembly-macos-amd64.xml
index 416a34c74..8564c632b 100644
--- a/script/assembly/collector/assembly-macos-amd64.xml
+++ b/script/assembly/collector/assembly-macos-amd64.xml
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/collector/assembly-macos-arm64.xml
b/script/assembly/collector/assembly-macos-arm64.xml
index 4394639af..de9f14f86 100644
--- a/script/assembly/collector/assembly-macos-arm64.xml
+++ b/script/assembly/collector/assembly-macos-arm64.xml
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/collector/assembly-windows-64.xml
b/script/assembly/collector/assembly-windows-64.xml
index fe7f14125..f457cd411 100644
--- a/script/assembly/collector/assembly-windows-64.xml
+++ b/script/assembly/collector/assembly-windows-64.xml
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/collector/assembly.xml
b/script/assembly/collector/assembly.xml
index 1d2beb0a9..5cae89831 100644
--- a/script/assembly/collector/assembly.xml
+++ b/script/assembly/collector/assembly.xml
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/collector/bin/entrypoint.sh
b/script/assembly/collector/bin/entrypoint.sh
index 0867dc8c4..c6a86adb8 100644
--- a/script/assembly/collector/bin/entrypoint.sh
+++ b/script/assembly/collector/bin/entrypoint.sh
@@ -17,10 +17,10 @@
# limitations under the License.
# project name
-SERVER_NAME="${project.build.finalName}"
+SERVER_NAME="hertzbeat-collector"
# jar name
-JAR_NAME="${project.build.finalName}.jar"
+#JAR_NAME="${project.build.finalName}.jar"
# cd bin
cd `dirname $0`
@@ -34,8 +34,10 @@ DEPLOY_DIR=`pwd`
# config dir
CONF_DIR=$DEPLOY_DIR/config
MAIN_CLASS="org.apache.hertzbeat.collector.Collector"
+LIB_PATH="$DEPLOY_DIR/lib"
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
-CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
+TARGET_LIB_PATH="$DEPLOY_DIR/target"
+CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
diff --git a/script/assembly/collector/bin/restart.sh
b/script/assembly/collector/bin/restart.sh
index 30bd4f6e5..3ef7f991c 100644
--- a/script/assembly/collector/bin/restart.sh
+++ b/script/assembly/collector/bin/restart.sh
@@ -16,14 +16,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# cd bin dir
+cd `dirname $0`
+# bin dir
+BIN_DIR=`pwd`
+# return root dir
+cd ..
+# root path dir
+DEPLOY_DIR=`pwd`
+
# restart start time
startTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is:$(date "+%Y-%m-%d %H:%M:%S") Restart
Now!\033[0m"
-./shutdown.sh
+$DEPLOY_DIR/bin/shutdown.sh
echo
sleep 2
echo
-./startup.sh
+$DEPLOY_DIR/bin/startup.sh
# restart end time
endTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is:$(date "+%Y-%m-%d %H:%M:%S") Restart
Success!Spend $((endTime - startTime)) seconds \033[0m";
diff --git a/script/assembly/collector/bin/shutdown.bat
b/script/assembly/collector/bin/shutdown.bat
index 41a4599ec..9acadc0d3 100644
--- a/script/assembly/collector/bin/shutdown.bat
+++ b/script/assembly/collector/bin/shutdown.bat
@@ -19,17 +19,17 @@
@echo off
setlocal enabledelayedexpansion
-set SERVER_NAME="${project.artifactId}"
+set SERVER_NAME="hertzbeat-collector"
set SERVER_PORT=1159
-echo Start shutdown HertzBeat %SERVER_NAME%
+echo Start shutdown HertzBeat %SERVER_NAME%
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
echo kill the process %%m who use the port
taskkill /pid %%m -t -f
- echo Shutdown HertzBeat %SERVER_NAME% Success!
+ echo Shutdown HertzBeat %SERVER_NAME% Success!
goto q
)
echo Failed shutdown HertzBeat %SERVER_NAME%
diff --git a/script/assembly/collector/bin/shutdown.sh
b/script/assembly/collector/bin/shutdown.sh
index e394ea154..bce36f4a2 100644
--- a/script/assembly/collector/bin/shutdown.sh
+++ b/script/assembly/collector/bin/shutdown.sh
@@ -16,10 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
-APPLICATION="${project.artifactId}"
+APPLICATION="hertzbeat-collector"
# jar file name
-APPLICATION_JAR="${project.build.finalName}.jar"
+APPLICATION_JAR="hertzbeat.collector"
# find the service pid, kill -9 pid
PID=$(ps -ef | grep java | grep "${APPLICATION_JAR}" | grep -v grep | awk '{
print $2 }')
diff --git a/script/assembly/collector/bin/startup.bat
b/script/assembly/collector/bin/startup.bat
index 03eeca153..d644e498f 100644
--- a/script/assembly/collector/bin/startup.bat
+++ b/script/assembly/collector/bin/startup.bat
@@ -19,9 +19,9 @@
@echo off
setlocal enabledelayedexpansion
-set SERVER_NAME=${project.artifactId}
+set SERVER_NAME="hertzbeat-collector"
-set JAR_NAME=${project.build.finalName}.jar
+@REM set JAR_NAME=${project.build.finalName}.jar
rem enter the bin directory
cd /d %~dp0
@@ -43,8 +43,10 @@ for /f "tokens=1-5" %%i in ('netstat -ano^|findstr
"0.0.0.0:%SERVER_PORT%"') do
)
set MAIN_CLASS=org.apache.hertzbeat.collector.Collector
set LOGS_DIR=%DEPLOY_DIR%\logs
+set LIB_PATH=%DEPLOY_DIR%\lib
set EXT_LIB_PATH=%DEPLOY_DIR%\ext-lib
-set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*
+set TARGET_LIB_PATH=%DEPLOY_DIR%\target
+set CLASSPATH=%LIB_PATH%\*;%TARGET_LIB_PATH%\*;%EXT_LIB_PATH%\*
if not exist %LOGS_DIR% (
mkdir %LOGS_DIR%
diff --git a/script/assembly/collector/bin/startup.sh
b/script/assembly/collector/bin/startup.sh
index 5b48adce4..ba29f20a4 100644
--- a/script/assembly/collector/bin/startup.sh
+++ b/script/assembly/collector/bin/startup.sh
@@ -17,10 +17,10 @@
# limitations under the License.
# project name
-SERVER_NAME="${project.artifactId}"
+SERVER_NAME="hertzbeat-collector"
# jar file name
-JAR_NAME="${project.build.finalName}.jar"
+#JAR_NAME="${project.build.finalName}.jar"
# cd bin dir
cd `dirname $0`
@@ -72,8 +72,10 @@ if [ -n "$SERVER_PORT" ]; then
fi
fi
MAIN_CLASS="org.apache.hertzbeat.collector.Collector"
+LIB_PATH="$DEPLOY_DIR/lib"
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
-CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
+TARGET_LIB_PATH="$DEPLOY_DIR/target"
+CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
diff --git a/script/assembly/server/assembly-linux-amd64.xml
b/script/assembly/server/assembly-linux-amd64.xml
index 05e519218..b18e5a702 100644
--- a/script/assembly/server/assembly-linux-amd64.xml
+++ b/script/assembly/server/assembly-linux-amd64.xml
@@ -72,7 +72,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/server/assembly-linux-arm64.xml
b/script/assembly/server/assembly-linux-arm64.xml
index 4e2158803..97895080b 100644
--- a/script/assembly/server/assembly-linux-arm64.xml
+++ b/script/assembly/server/assembly-linux-arm64.xml
@@ -72,7 +72,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/server/assembly-macos-amd64.xml
b/script/assembly/server/assembly-macos-amd64.xml
index 3c68541b4..38a4e666d 100644
--- a/script/assembly/server/assembly-macos-amd64.xml
+++ b/script/assembly/server/assembly-macos-amd64.xml
@@ -72,7 +72,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/server/assembly-macos-arm64.xml
b/script/assembly/server/assembly-macos-arm64.xml
index c230d513b..4f6af2bfd 100644
--- a/script/assembly/server/assembly-macos-arm64.xml
+++ b/script/assembly/server/assembly-macos-arm64.xml
@@ -71,7 +71,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/server/assembly-windows-64.xml
b/script/assembly/server/assembly-windows-64.xml
index b2ba21b23..1ba8940cc 100644
--- a/script/assembly/server/assembly-windows-64.xml
+++ b/script/assembly/server/assembly-windows-64.xml
@@ -72,7 +72,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/server/assembly.xml
b/script/assembly/server/assembly.xml
index 249a0b3e3..981260b70 100644
--- a/script/assembly/server/assembly.xml
+++ b/script/assembly/server/assembly.xml
@@ -71,7 +71,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
- <outputDirectory>/</outputDirectory>
+ <outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
diff --git a/script/assembly/server/bin/entrypoint.sh
b/script/assembly/server/bin/entrypoint.sh
index 0a9b0b26e..19eda3003 100644
--- a/script/assembly/server/bin/entrypoint.sh
+++ b/script/assembly/server/bin/entrypoint.sh
@@ -17,10 +17,10 @@
# limitations under the License.
# project name
-SERVER_NAME="${project.build.finalName}"
+SERVER_NAME="hertzbeat-manager"
# jar name
-JAR_NAME="${project.build.finalName}.jar"
+#JAR_NAME="${project.build.finalName}.jar"
# cd bin
cd `dirname $0`
@@ -36,8 +36,10 @@ DEPLOY_DIR=`pwd`
# if a directory is specified, spring will read all configuration files in the
directory
CONF_DIR=$DEPLOY_DIR/config
MAIN_CLASS="org.apache.hertzbeat.manager.Manager"
+LIB_PATH="$DEPLOY_DIR/lib"
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
-CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
+TARGET_LIB_PATH="$DEPLOY_DIR/target"
+CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
diff --git a/script/assembly/server/bin/restart.sh
b/script/assembly/server/bin/restart.sh
index 30bd4f6e5..3ef7f991c 100644
--- a/script/assembly/server/bin/restart.sh
+++ b/script/assembly/server/bin/restart.sh
@@ -16,14 +16,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# cd bin dir
+cd `dirname $0`
+# bin dir
+BIN_DIR=`pwd`
+# return root dir
+cd ..
+# root path dir
+DEPLOY_DIR=`pwd`
+
# restart start time
startTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is:$(date "+%Y-%m-%d %H:%M:%S") Restart
Now!\033[0m"
-./shutdown.sh
+$DEPLOY_DIR/bin/shutdown.sh
echo
sleep 2
echo
-./startup.sh
+$DEPLOY_DIR/bin/startup.sh
# restart end time
endTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is:$(date "+%Y-%m-%d %H:%M:%S") Restart
Success!Spend $((endTime - startTime)) seconds \033[0m";
diff --git a/script/assembly/server/bin/shutdown.bat
b/script/assembly/server/bin/shutdown.bat
index 2c6de2330..5cb181d4e 100644
--- a/script/assembly/server/bin/shutdown.bat
+++ b/script/assembly/server/bin/shutdown.bat
@@ -19,17 +19,17 @@
@echo off
setlocal enabledelayedexpansion
-set SERVER_NAME="${project.artifactId}"
+set SERVER_NAME="hertzbeat-manager"
set SERVER_PORT=1157
-echo Start shutdown HertzBeat %SERVER_NAME%
+echo Start shutdown HertzBeat %SERVER_NAME%
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
echo kill the process %%m who use the port
taskkill /pid %%m -t -f
- echo Shutdown HertzBeat %SERVER_NAME% Success!
+ echo Shutdown HertzBeat %SERVER_NAME% Success!
goto q
)
echo Failed shutdown HertzBeat %SERVER_NAME%
diff --git a/script/assembly/server/bin/shutdown.sh
b/script/assembly/server/bin/shutdown.sh
index ea38cdfaf..9427134a6 100644
--- a/script/assembly/server/bin/shutdown.sh
+++ b/script/assembly/server/bin/shutdown.sh
@@ -16,10 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
-APPLICATION="${project.artifactId}"
+APPLICATION="hertzbeat-manager"
# jar file name
-APPLICATION_JAR="${project.build.finalName}.jar"
+APPLICATION_JAR="hertzbeat.manager"
# find the service pid, kill -9 pid
PID=$(ps -ef | grep java | grep "${APPLICATION_JAR}" | grep -v grep | awk '{
print $2 }')
diff --git a/script/assembly/server/bin/startup.bat
b/script/assembly/server/bin/startup.bat
index 2647ed078..81fe636ff 100644
--- a/script/assembly/server/bin/startup.bat
+++ b/script/assembly/server/bin/startup.bat
@@ -19,9 +19,9 @@
@echo off
setlocal enabledelayedexpansion
-set SERVER_NAME=${project.artifactId}
+set SERVER_NAME="hertzbeat-manager"
-set JAR_NAME=${project.build.finalName}.jar
+@REM set JAR_NAME=${project.build.finalName}.jar
rem enter the bin directory
cd /d %~dp0
@@ -43,8 +43,10 @@ for /f "tokens=1-5" %%i in ('netstat -ano^|findstr
"0.0.0.0:%SERVER_PORT%"') do
)
set MAIN_CLASS=org.apache.hertzbeat.manager.Manager
set LOGS_DIR=%DEPLOY_DIR%\logs
+set LIB_PATH=%DEPLOY_DIR%\lib
set EXT_LIB_PATH=%DEPLOY_DIR%\ext-lib
-set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*
+set TARGET_LIB_PATH=%DEPLOY_DIR%\target
+set CLASSPATH=%LIB_PATH%\*;%TARGET_LIB_PATH%\*;%EXT_LIB_PATH%\*
if not exist %LOGS_DIR% (
mkdir %LOGS_DIR%
diff --git a/script/assembly/server/bin/startup.sh
b/script/assembly/server/bin/startup.sh
index e3dd9a853..138527042 100644
--- a/script/assembly/server/bin/startup.sh
+++ b/script/assembly/server/bin/startup.sh
@@ -17,10 +17,10 @@
# limitations under the License.
# project name
-SERVER_NAME="${project.artifactId}"
+SERVER_NAME="hertzbeat-manager"
# jar file name
-JAR_NAME="${project.build.finalName}.jar"
+#JAR_NAME="${project.build.finalName}.jar"
# cd bin dir
cd `dirname $0`
@@ -74,8 +74,10 @@ if [ -n "$SERVER_PORT" ]; then
fi
fi
MAIN_CLASS="org.apache.hertzbeat.manager.Manager"
+LIB_PATH="$DEPLOY_DIR/lib"
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
-CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
+TARGET_LIB_PATH="$DEPLOY_DIR/target"
+CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]