Skip to content

Commit 85b4a4e

Browse files
authored
[improve] revert modify bin shells (apache#2735)
1 parent febc911 commit 85b4a4e

24 files changed

+44
-74
lines changed

script/assembly/collector/assembly-linux-amd64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
6666
<!-- Pack the startup jar in the target directory to the directory-->
6767
<fileSet>
6868
<directory>target</directory>
69-
<outputDirectory>/lib</outputDirectory>
69+
<outputDirectory>/</outputDirectory>
7070
<includes>
7171
<include>*.jar</include>
7272
</includes>

script/assembly/collector/assembly-linux-arm64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
6666
<!-- Pack the startup jar in the target directory to the directory-->
6767
<fileSet>
6868
<directory>target</directory>
69-
<outputDirectory>/lib</outputDirectory>
69+
<outputDirectory>/</outputDirectory>
7070
<includes>
7171
<include>*.jar</include>
7272
</includes>

script/assembly/collector/assembly-macos-amd64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
6666
<!-- Pack the startup jar in the target directory to the directory-->
6767
<fileSet>
6868
<directory>target</directory>
69-
<outputDirectory>/lib</outputDirectory>
69+
<outputDirectory>/</outputDirectory>
7070
<includes>
7171
<include>*.jar</include>
7272
</includes>

script/assembly/collector/assembly-macos-arm64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
6666
<!-- Pack the startup jar in the target directory to the directory-->
6767
<fileSet>
6868
<directory>target</directory>
69-
<outputDirectory>/lib</outputDirectory>
69+
<outputDirectory>/</outputDirectory>
7070
<includes>
7171
<include>*.jar</include>
7272
</includes>

script/assembly/collector/assembly-windows-64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
6666
<!-- Pack the startup jar in the target directory to the directory-->
6767
<fileSet>
6868
<directory>target</directory>
69-
<outputDirectory>/lib</outputDirectory>
69+
<outputDirectory>/</outputDirectory>
7070
<includes>
7171
<include>*.jar</include>
7272
</includes>

script/assembly/collector/assembly.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
6666
<!-- Pack the startup jar in the target directory to the directory-->
6767
<fileSet>
6868
<directory>target</directory>
69-
<outputDirectory>/lib</outputDirectory>
69+
<outputDirectory>/</outputDirectory>
7070
<includes>
7171
<include>*.jar</include>
7272
</includes>

script/assembly/collector/bin/entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
# limitations under the License.
1818

1919
# project name
20-
SERVER_NAME="hertzbeat-collector"
20+
SERVER_NAME="${project.build.finalName}"
2121

2222
# jar name
23-
#JAR_NAME="${project.build.finalName}.jar"
23+
JAR_NAME="${project.build.finalName}.jar"
2424

2525
# cd bin
2626
cd `dirname $0`
@@ -34,10 +34,8 @@ DEPLOY_DIR=`pwd`
3434
# config dir
3535
CONF_DIR=$DEPLOY_DIR/config
3636
MAIN_CLASS="org.apache.hertzbeat.collector.Collector"
37-
LIB_PATH="$DEPLOY_DIR/lib"
3837
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
39-
TARGET_LIB_PATH="$DEPLOY_DIR/target"
40-
CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
38+
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
4139
# log dir
4240
LOGS_DIR=$DEPLOY_DIR/logs
4341
# create logs dir when not exist

script/assembly/collector/bin/restart.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,14 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818

19-
# cd bin dir
20-
cd `dirname $0`
21-
# bin dir
22-
BIN_DIR=`pwd`
23-
# return root dir
24-
cd ..
25-
# root path dir
26-
DEPLOY_DIR=`pwd`
27-
2819
# restart start time
2920
startTime=$(date +%s)
3021
echo -e "\033[0;31mCurrent Time is:$(date "+%Y-%m-%d %H:%M:%S") Restart Now!\033[0m"
31-
$DEPLOY_DIR/bin/shutdown.sh
22+
./shutdown.sh
3223
echo
3324
sleep 2
3425
echo
35-
$DEPLOY_DIR/bin/startup.sh
26+
./startup.sh
3627
# restart end time
3728
endTime=$(date +%s)
3829
echo -e "\033[0;31mCurrent Time is:$(date "+%Y-%m-%d %H:%M:%S") Restart Success!Spend $((endTime - startTime)) seconds \033[0m";

script/assembly/collector/bin/shutdown.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
@echo off
2020
setlocal enabledelayedexpansion
2121

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

2424

2525
set SERVER_PORT=1159
2626

27-
echo Start shutdown HertzBeat %SERVER_NAME%
27+
echo Start shutdown HertzBeat %SERVER_NAME%
2828

2929
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
3030
echo kill the process %%m who use the port
3131
taskkill /pid %%m -t -f
32-
echo Shutdown HertzBeat %SERVER_NAME% Success!
32+
echo Shutdown HertzBeat %SERVER_NAME% Success!
3333
goto q
3434
)
3535
echo Failed shutdown HertzBeat %SERVER_NAME%

script/assembly/collector/bin/shutdown.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818
# project name
19-
APPLICATION="hertzbeat-collector"
19+
APPLICATION="${project.artifactId}"
2020

2121
# jar file name
22-
APPLICATION_JAR="hertzbeat.collector"
22+
APPLICATION_JAR="${project.build.finalName}.jar"
2323

2424
# find the service pid, kill -9 pid
2525
PID=$(ps -ef | grep java | grep "${APPLICATION_JAR}" | grep -v grep | awk '{ print $2 }')

script/assembly/collector/bin/startup.bat

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
@echo off
2020
setlocal enabledelayedexpansion
2121

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

24-
@REM set JAR_NAME=${project.build.finalName}.jar
24+
set JAR_NAME=${project.build.finalName}.jar
2525

2626
rem enter the bin directory
2727
cd /d %~dp0
@@ -43,10 +43,8 @@ for /f "tokens=1-5" %%i in ('netstat -ano^|findstr "0.0.0.0:%SERVER_PORT%"') do
4343
)
4444
set MAIN_CLASS=org.apache.hertzbeat.collector.Collector
4545
set LOGS_DIR=%DEPLOY_DIR%\logs
46-
set LIB_PATH=%DEPLOY_DIR%\lib
4746
set EXT_LIB_PATH=%DEPLOY_DIR%\ext-lib
48-
set TARGET_LIB_PATH=%DEPLOY_DIR%\target
49-
set CLASSPATH=%LIB_PATH%\*;%TARGET_LIB_PATH%\*;%EXT_LIB_PATH%\*
47+
set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*
5048

5149
if not exist %LOGS_DIR% (
5250
mkdir %LOGS_DIR%

script/assembly/collector/bin/startup.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
# limitations under the License.
1818

1919
# project name
20-
SERVER_NAME="hertzbeat-collector"
20+
SERVER_NAME="${project.artifactId}"
2121

2222
# jar file name
23-
#JAR_NAME="${project.build.finalName}.jar"
23+
JAR_NAME="${project.build.finalName}.jar"
2424

2525
# cd bin dir
2626
cd `dirname $0`
@@ -72,10 +72,8 @@ if [ -n "$SERVER_PORT" ]; then
7272
fi
7373
fi
7474
MAIN_CLASS="org.apache.hertzbeat.collector.Collector"
75-
LIB_PATH="$DEPLOY_DIR/lib"
7675
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
77-
TARGET_LIB_PATH="$DEPLOY_DIR/target"
78-
CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
76+
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
7977
# log dir
8078
LOGS_DIR=$DEPLOY_DIR/logs
8179
# create logs dir when not exist

script/assembly/server/assembly-linux-amd64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
7272
<!-- Pack the startup jar in the target directory to the directory-->
7373
<fileSet>
7474
<directory>target</directory>
75-
<outputDirectory>/lib</outputDirectory>
75+
<outputDirectory>/</outputDirectory>
7676
<includes>
7777
<include>*.jar</include>
7878
</includes>

script/assembly/server/assembly-linux-arm64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
7272
<!-- Pack the startup jar in the target directory to the directory-->
7373
<fileSet>
7474
<directory>target</directory>
75-
<outputDirectory>/lib</outputDirectory>
75+
<outputDirectory>/</outputDirectory>
7676
<includes>
7777
<include>*.jar</include>
7878
</includes>

script/assembly/server/assembly-macos-amd64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
7272
<!-- Pack the startup jar in the target directory to the directory-->
7373
<fileSet>
7474
<directory>target</directory>
75-
<outputDirectory>/lib</outputDirectory>
75+
<outputDirectory>/</outputDirectory>
7676
<includes>
7777
<include>*.jar</include>
7878
</includes>

script/assembly/server/assembly-macos-arm64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
7171
<!-- Pack the startup jar in the target directory to the directory-->
7272
<fileSet>
7373
<directory>target</directory>
74-
<outputDirectory>/lib</outputDirectory>
74+
<outputDirectory>/</outputDirectory>
7575
<includes>
7676
<include>*.jar</include>
7777
</includes>

script/assembly/server/assembly-windows-64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
7272
<!-- Pack the startup jar in the target directory to the directory-->
7373
<fileSet>
7474
<directory>target</directory>
75-
<outputDirectory>/lib</outputDirectory>
75+
<outputDirectory>/</outputDirectory>
7676
<includes>
7777
<include>*.jar</include>
7878
</includes>

script/assembly/server/assembly.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ http://maven.apache.org/ASSEMBLY/2.0.0 ">
7171
<!-- Pack the startup jar in the target directory to the directory-->
7272
<fileSet>
7373
<directory>target</directory>
74-
<outputDirectory>/lib</outputDirectory>
74+
<outputDirectory>/</outputDirectory>
7575
<includes>
7676
<include>*.jar</include>
7777
</includes>

script/assembly/server/bin/entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
# limitations under the License.
1818

1919
# project name
20-
SERVER_NAME="hertzbeat-manager"
20+
SERVER_NAME="${project.build.finalName}"
2121

2222
# jar name
23-
#JAR_NAME="${project.build.finalName}.jar"
23+
JAR_NAME="${project.build.finalName}.jar"
2424

2525
# cd bin
2626
cd `dirname $0`
@@ -36,10 +36,8 @@ DEPLOY_DIR=`pwd`
3636
# if a directory is specified, spring will read all configuration files in the directory
3737
CONF_DIR=$DEPLOY_DIR/config
3838
MAIN_CLASS="org.apache.hertzbeat.manager.Manager"
39-
LIB_PATH="$DEPLOY_DIR/lib"
4039
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
41-
TARGET_LIB_PATH="$DEPLOY_DIR/target"
42-
CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
40+
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
4341
# log dir
4442
LOGS_DIR=$DEPLOY_DIR/logs
4543
# create logs dir when not exist

script/assembly/server/bin/restart.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,14 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818

19-
# cd bin dir
20-
cd `dirname $0`
21-
# bin dir
22-
BIN_DIR=`pwd`
23-
# return root dir
24-
cd ..
25-
# root path dir
26-
DEPLOY_DIR=`pwd`
27-
2819
# restart start time
2920
startTime=$(date +%s)
3021
echo -e "\033[0;31mCurrent Time is:$(date "+%Y-%m-%d %H:%M:%S") Restart Now!\033[0m"
31-
$DEPLOY_DIR/bin/shutdown.sh
22+
./shutdown.sh
3223
echo
3324
sleep 2
3425
echo
35-
$DEPLOY_DIR/bin/startup.sh
26+
./startup.sh
3627
# restart end time
3728
endTime=$(date +%s)
3829
echo -e "\033[0;31mCurrent Time is:$(date "+%Y-%m-%d %H:%M:%S") Restart Success!Spend $((endTime - startTime)) seconds \033[0m";

script/assembly/server/bin/shutdown.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
@echo off
2020
setlocal enabledelayedexpansion
2121

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

2424

2525
set SERVER_PORT=1157
2626

27-
echo Start shutdown HertzBeat %SERVER_NAME%
27+
echo Start shutdown HertzBeat %SERVER_NAME%
2828

2929
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
3030
echo kill the process %%m who use the port
3131
taskkill /pid %%m -t -f
32-
echo Shutdown HertzBeat %SERVER_NAME% Success!
32+
echo Shutdown HertzBeat %SERVER_NAME% Success!
3333
goto q
3434
)
3535
echo Failed shutdown HertzBeat %SERVER_NAME%

script/assembly/server/bin/shutdown.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818
# project name
19-
APPLICATION="hertzbeat-manager"
19+
APPLICATION="${project.artifactId}"
2020

2121
# jar file name
22-
APPLICATION_JAR="hertzbeat.manager"
22+
APPLICATION_JAR="${project.build.finalName}.jar"
2323

2424
# find the service pid, kill -9 pid
2525
PID=$(ps -ef | grep java | grep "${APPLICATION_JAR}" | grep -v grep | awk '{ print $2 }')

script/assembly/server/bin/startup.bat

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
@echo off
2020
setlocal enabledelayedexpansion
2121

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

24-
@REM set JAR_NAME=${project.build.finalName}.jar
24+
set JAR_NAME=${project.build.finalName}.jar
2525

2626
rem enter the bin directory
2727
cd /d %~dp0
@@ -43,10 +43,8 @@ for /f "tokens=1-5" %%i in ('netstat -ano^|findstr "0.0.0.0:%SERVER_PORT%"') do
4343
)
4444
set MAIN_CLASS=org.apache.hertzbeat.manager.Manager
4545
set LOGS_DIR=%DEPLOY_DIR%\logs
46-
set LIB_PATH=%DEPLOY_DIR%\lib
4746
set EXT_LIB_PATH=%DEPLOY_DIR%\ext-lib
48-
set TARGET_LIB_PATH=%DEPLOY_DIR%\target
49-
set CLASSPATH=%LIB_PATH%\*;%TARGET_LIB_PATH%\*;%EXT_LIB_PATH%\*
47+
set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*
5048

5149
if not exist %LOGS_DIR% (
5250
mkdir %LOGS_DIR%

script/assembly/server/bin/startup.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
# limitations under the License.
1818

1919
# project name
20-
SERVER_NAME="hertzbeat-manager"
20+
SERVER_NAME="${project.artifactId}"
2121

2222
# jar file name
23-
#JAR_NAME="${project.build.finalName}.jar"
23+
JAR_NAME="${project.build.finalName}.jar"
2424

2525
# cd bin dir
2626
cd `dirname $0`
@@ -74,10 +74,8 @@ if [ -n "$SERVER_PORT" ]; then
7474
fi
7575
fi
7676
MAIN_CLASS="org.apache.hertzbeat.manager.Manager"
77-
LIB_PATH="$DEPLOY_DIR/lib"
7877
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
79-
TARGET_LIB_PATH="$DEPLOY_DIR/target"
80-
CLASSPATH="$LIB_PATH/*:$TARGET_LIB_PATH/*:$EXT_LIB_PATH/*"
78+
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
8179
# log dir
8280
LOGS_DIR=$DEPLOY_DIR/logs
8381
# create logs dir when not exist

0 commit comments

Comments
 (0)