Skip to content

Commit

Permalink
[improve] revert modify bin shells (#2735)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsun28 authored Sep 21, 2024
1 parent febc911 commit 85b4a4e
Show file tree
Hide file tree
Showing 24 changed files with 44 additions and 74 deletions.
2 changes: 1 addition & 1 deletion script/assembly/collector/assembly-linux-amd64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/collector/assembly-linux-arm64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/collector/assembly-macos-amd64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/collector/assembly-macos-arm64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/collector/assembly-windows-64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/collector/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
8 changes: 3 additions & 5 deletions script/assembly/collector/bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# limitations under the License.

# project name
SERVER_NAME="hertzbeat-collector"
SERVER_NAME="${project.build.finalName}"

# jar name
#JAR_NAME="${project.build.finalName}.jar"
JAR_NAME="${project.build.finalName}.jar"

# cd bin
cd `dirname $0`
Expand All @@ -34,10 +34,8 @@ 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"
TARGET_LIB_PATH="$DEPLOY_DIR/target"
CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
Expand Down
13 changes: 2 additions & 11 deletions script/assembly/collector/bin/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,14 @@
# 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"
$DEPLOY_DIR/bin/shutdown.sh
./shutdown.sh
echo
sleep 2
echo
$DEPLOY_DIR/bin/startup.sh
./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";
6 changes: 3 additions & 3 deletions script/assembly/collector/bin/shutdown.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
@echo off
setlocal enabledelayedexpansion

set SERVER_NAME="hertzbeat-collector"
set SERVER_NAME="${project.artifactId}"


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%
Expand Down
4 changes: 2 additions & 2 deletions script/assembly/collector/bin/shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
APPLICATION="hertzbeat-collector"
APPLICATION="${project.artifactId}"

# jar file name
APPLICATION_JAR="hertzbeat.collector"
APPLICATION_JAR="${project.build.finalName}.jar"

# find the service pid, kill -9 pid
PID=$(ps -ef | grep java | grep "${APPLICATION_JAR}" | grep -v grep | awk '{ print $2 }')
Expand Down
8 changes: 3 additions & 5 deletions script/assembly/collector/bin/startup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
@echo off
setlocal enabledelayedexpansion

set SERVER_NAME="hertzbeat-collector"
set SERVER_NAME=${project.artifactId}

@REM set JAR_NAME=${project.build.finalName}.jar
set JAR_NAME=${project.build.finalName}.jar

rem enter the bin directory
cd /d %~dp0
Expand All @@ -43,10 +43,8 @@ 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 TARGET_LIB_PATH=%DEPLOY_DIR%\target
set CLASSPATH=%LIB_PATH%\*;%TARGET_LIB_PATH%\*;%EXT_LIB_PATH%\*
set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*

if not exist %LOGS_DIR% (
mkdir %LOGS_DIR%
Expand Down
8 changes: 3 additions & 5 deletions script/assembly/collector/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# limitations under the License.

# project name
SERVER_NAME="hertzbeat-collector"
SERVER_NAME="${project.artifactId}"

# jar file name
#JAR_NAME="${project.build.finalName}.jar"
JAR_NAME="${project.build.finalName}.jar"

# cd bin dir
cd `dirname $0`
Expand Down Expand Up @@ -72,10 +72,8 @@ 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"
TARGET_LIB_PATH="$DEPLOY_DIR/target"
CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/server/assembly-linux-amd64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/server/assembly-linux-arm64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/server/assembly-macos-amd64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/server/assembly-macos-arm64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/server/assembly-windows-64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion script/assembly/server/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>/lib</outputDirectory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
Expand Down
8 changes: 3 additions & 5 deletions script/assembly/server/bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# limitations under the License.

# project name
SERVER_NAME="hertzbeat-manager"
SERVER_NAME="${project.build.finalName}"

# jar name
#JAR_NAME="${project.build.finalName}.jar"
JAR_NAME="${project.build.finalName}.jar"

# cd bin
cd `dirname $0`
Expand All @@ -36,10 +36,8 @@ 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"
TARGET_LIB_PATH="$DEPLOY_DIR/target"
CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
Expand Down
13 changes: 2 additions & 11 deletions script/assembly/server/bin/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,14 @@
# 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"
$DEPLOY_DIR/bin/shutdown.sh
./shutdown.sh
echo
sleep 2
echo
$DEPLOY_DIR/bin/startup.sh
./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";
6 changes: 3 additions & 3 deletions script/assembly/server/bin/shutdown.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
@echo off
setlocal enabledelayedexpansion

set SERVER_NAME="hertzbeat-manager"
set SERVER_NAME="${project.artifactId}"


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%
Expand Down
4 changes: 2 additions & 2 deletions script/assembly/server/bin/shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
APPLICATION="hertzbeat-manager"
APPLICATION="${project.artifactId}"

# jar file name
APPLICATION_JAR="hertzbeat.manager"
APPLICATION_JAR="${project.build.finalName}.jar"

# find the service pid, kill -9 pid
PID=$(ps -ef | grep java | grep "${APPLICATION_JAR}" | grep -v grep | awk '{ print $2 }')
Expand Down
8 changes: 3 additions & 5 deletions script/assembly/server/bin/startup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
@echo off
setlocal enabledelayedexpansion

set SERVER_NAME="hertzbeat-manager"
set SERVER_NAME=${project.artifactId}

@REM set JAR_NAME=${project.build.finalName}.jar
set JAR_NAME=${project.build.finalName}.jar

rem enter the bin directory
cd /d %~dp0
Expand All @@ -43,10 +43,8 @@ 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 TARGET_LIB_PATH=%DEPLOY_DIR%\target
set CLASSPATH=%LIB_PATH%\*;%TARGET_LIB_PATH%\*;%EXT_LIB_PATH%\*
set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*

if not exist %LOGS_DIR% (
mkdir %LOGS_DIR%
Expand Down
8 changes: 3 additions & 5 deletions script/assembly/server/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# limitations under the License.

# project name
SERVER_NAME="hertzbeat-manager"
SERVER_NAME="${project.artifactId}"

# jar file name
#JAR_NAME="${project.build.finalName}.jar"
JAR_NAME="${project.build.finalName}.jar"

# cd bin dir
cd `dirname $0`
Expand Down Expand Up @@ -74,10 +74,8 @@ 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"
TARGET_LIB_PATH="$DEPLOY_DIR/target"
CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
Expand Down

0 comments on commit 85b4a4e

Please sign in to comment.