Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
84c9c7bd
Commit
84c9c7bd
authored
Oct 13, 2016
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
7c870ea4
57b7357b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
9 deletions
+38
-9
SysVinitLaunchScriptIT.java
...ngframework/boot/launchscript/SysVinitLaunchScriptIT.java
+12
-0
launch-with-multiple-java-opts.sh
.../test/resources/scripts/launch-with-multiple-java-opts.sh
+1
-1
launch-with-multiple-run-args.sh
...c/test/resources/scripts/launch-with-multiple-run-args.sh
+1
-1
launch-with-relative-pid-folder.sh
...test/resources/scripts/launch-with-relative-pid-folder.sh
+10
-0
launch-with-single-java-opt.sh
...src/test/resources/scripts/launch-with-single-java-opt.sh
+1
-1
launch-with-single-run-arg.sh
.../src/test/resources/scripts/launch-with-single-run-arg.sh
+1
-1
launch-with-use-of-start-stop-daemon-disabled.sh
.../scripts/launch-with-use-of-start-stop-daemon-disabled.sh
+1
-1
test-functions.sh
...script-tests/src/test/resources/scripts/test-functions.sh
+4
-3
launch.script
...urces/org/springframework/boot/loader/tools/launch.script
+7
-1
No files found.
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java
View file @
84c9c7bd
...
...
@@ -198,6 +198,18 @@ public class SysVinitLaunchScriptIT {
doLaunch
(
"launch-with-use-of-start-stop-daemon-disabled.sh"
);
}
@Test
public
void
launchWithRelativePidFolder
()
throws
Exception
{
String
output
=
doTest
(
"launch-with-relative-pid-folder.sh"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
GREEN
,
"Started ["
+
extractPid
(
output
)
+
"]"
));
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
GREEN
,
"Running ["
+
extractPid
(
output
)
+
"]"
));
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
GREEN
,
"Stopped ["
+
extractPid
(
output
)
+
"]"
));
}
private
void
doLaunch
(
String
script
)
throws
Exception
{
assertThat
(
doTest
(
script
)).
contains
(
"Launched"
);
}
...
...
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-multiple-java-opts.sh
View file @
84c9c7bd
source
./test-functions.sh
echo
'JAVA_OPTS="-Dserver.port=8081 -Dserver.context-path=/test"'
>
/spring-boot-app.conf
install_service
echo
'JAVA_OPTS="-Dserver.port=8081 -Dserver.context-path=/test"'
>
/test-service/spring-boot-app.conf
start_service
await_app http://127.0.0.1:8081/test/
curl
-s
http://127.0.0.1:8081/test/
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-multiple-run-args.sh
View file @
84c9c7bd
source
./test-functions.sh
echo
'RUN_ARGS="--server.port=8081 --server.context-path=/test"'
>
/spring-boot-app.conf
install_service
echo
'RUN_ARGS="--server.port=8081 --server.context-path=/test"'
>
/test-service/spring-boot-app.conf
start_service
await_app http://127.0.0.1:8081/test/
curl
-s
http://127.0.0.1:8081/test/
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-relative-pid-folder.sh
0 → 100755
View file @
84c9c7bd
source
./test-functions.sh
mkdir
./pid
install_service
echo
'PID_FOLDER=./pid'
>
/test-service/spring-boot-app.conf
start_service
echo
"PID:
$(
cat
/test-service/pid/spring-boot-app/spring-boot-app.pid
)
"
await_app
curl
-s
http://127.0.0.1:8080/
status_service
stop_service
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-single-java-opt.sh
View file @
84c9c7bd
source
./test-functions.sh
echo
'JAVA_OPTS=-Dserver.port=8081'
>
/spring-boot-app.conf
install_service
echo
'JAVA_OPTS=-Dserver.port=8081'
>
/test-service/spring-boot-app.conf
start_service
await_app http://127.0.0.1:8081/
curl
-s
http://127.0.0.1:8081/
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-single-run-arg.sh
View file @
84c9c7bd
source
./test-functions.sh
echo
'RUN_ARGS=--server.port=8081'
>
/spring-boot-app.conf
install_service
echo
'RUN_ARGS=--server.port=8081'
>
/test-service/spring-boot-app.conf
start_service
await_app http://127.0.0.1:8081/
curl
-s
http://127.0.0.1:8081/
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-use-of-start-stop-daemon-disabled.sh
View file @
84c9c7bd
source
./test-functions.sh
chmod
-x
$(
type
-p
start-stop-daemon
)
echo
'USE_START_STOP_DAEMON=false'
>
/spring-boot-app.conf
install_service
echo
'USE_START_STOP_DAEMON=false'
>
/test-service/spring-boot-app.conf
start_service
await_app
curl
-s
http://127.0.0.1:8080/
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/test-functions.sh
View file @
84c9c7bd
install_service
()
{
mv
/spring-boot-launch-script-tests-
*
.jar /spring-boot-app.jar
chmod
+x /spring-boot-app.jar
ln
-s
/spring-boot-app.jar /etc/init.d/spring-boot-app
mkdir
/test-service
mv
/spring-boot-launch-script-tests-
*
.jar /test-service/spring-boot-app.jar
chmod
+x /test-service/spring-boot-app.jar
ln
-s
/test-service/spring-boot-app.jar /etc/init.d/spring-boot-app
}
start_service
()
{
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
View file @
84c9c7bd
...
...
@@ -145,7 +145,7 @@ start() {
do_start
()
{
working_dir
=
$(
dirname
"
$jarfile
"
)
pushd
"
$working_dir
"
>
/dev/null
mkdir
"
$PID_FOLDER
"
&> /dev/null
mkdir
-p
"
$PID_FOLDER
"
&> /dev/null
if
[[
-n
"
$run_user
"
]]
;
then
checkPermissions
||
return
$?
if
[[
-z
"
$pid_subfolder
"
]]
;
then
...
...
@@ -180,6 +180,8 @@ do_start() {
}
stop
()
{
working_dir
=
$(
dirname
"
$jarfile
"
)
pushd
"
$working_dir
"
>
/dev/null
[[
-f
$pid_file
]]
||
{
echoYellow
"Not running (pidfile not found)"
;
return
0
;
}
pid
=
$(
cat
"
$pid_file
"
)
isRunning
"
$pid
"
||
{
echoYellow
"Not running (process
${
pid
}
). Removing stale pid file."
;
rm
-f
"
$pid_file
"
;
return
0
;
}
...
...
@@ -202,6 +204,8 @@ restart() {
}
force_reload
()
{
working_dir
=
$(
dirname
"
$jarfile
"
)
pushd
"
$working_dir
"
>
/dev/null
[[
-f
$pid_file
]]
||
{
echoRed
"Not running (pidfile not found)"
;
return
7
;
}
pid
=
$(
cat
"
$pid_file
"
)
rm
-f
"
$pid_file
"
...
...
@@ -211,6 +215,8 @@ force_reload() {
}
status
()
{
working_dir
=
$(
dirname
"
$jarfile
"
)
pushd
"
$working_dir
"
>
/dev/null
[[
-f
"
$pid_file
"
]]
||
{
echoRed
"Not running"
;
return
3
;
}
pid
=
$(
cat
"
$pid_file
"
)
isRunning
"
$pid
"
||
{
echoRed
"Not running (process
${
pid
}
not found)"
;
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment