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
56a58880
Commit
56a58880
authored
Apr 25, 2017
by
Ali Shahbour
Committed by
Andy Wilkinson
Sep 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Find .conf file next to symlink to jar that's using the launch script
See gh-8988
parent
b59bc20f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
2 deletions
+28
-2
SysVinitLaunchScriptIT.java
...ngframework/boot/launchscript/SysVinitLaunchScriptIT.java
+7
-0
launch-with-double-link-single-java-opt.sh
...ources/scripts/launch-with-double-link-single-java-opt.sh
+6
-0
test-functions.sh
...script-tests/src/test/resources/scripts/test-functions.sh
+8
-0
launch.script
...urces/org/springframework/boot/loader/tools/launch.script
+7
-2
No files found.
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java
View file @
56a58880
...
@@ -59,6 +59,7 @@ import static org.junit.Assume.assumeThat;
...
@@ -59,6 +59,7 @@ import static org.junit.Assume.assumeThat;
* Integration tests for Spring Boot's launch script on OSs that use SysVinit.
* Integration tests for Spring Boot's launch script on OSs that use SysVinit.
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
* @author Ali Shahbour
*/
*/
@RunWith
(
Parameterized
.
class
)
@RunWith
(
Parameterized
.
class
)
public
class
SysVinitLaunchScriptIT
{
public
class
SysVinitLaunchScriptIT
{
...
@@ -194,6 +195,12 @@ public class SysVinitLaunchScriptIT {
...
@@ -194,6 +195,12 @@ public class SysVinitLaunchScriptIT {
doLaunch
(
"launch-with-single-java-opt.sh"
);
doLaunch
(
"launch-with-single-java-opt.sh"
);
}
}
@Test
public
void
launchWithDoubleLinkSingleJavaOpt
()
throws
Exception
{
doLaunch
(
"launch-with-double-link-single-java-opt.sh"
);
}
@Test
@Test
public
void
launchWithMultipleJavaOpts
()
throws
Exception
{
public
void
launchWithMultipleJavaOpts
()
throws
Exception
{
doLaunch
(
"launch-with-multiple-java-opts.sh"
);
doLaunch
(
"launch-with-multiple-java-opts.sh"
);
...
...
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-double-link-single-java-opt.sh
0 → 100755
View file @
56a58880
source
./test-functions.sh
install_double_link_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/
\ No newline at end of file
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/test-functions.sh
View file @
56a58880
...
@@ -5,6 +5,14 @@ install_service() {
...
@@ -5,6 +5,14 @@ install_service() {
ln
-s
/test-service/spring-boot-app.jar /etc/init.d/spring-boot-app
ln
-s
/test-service/spring-boot-app.jar /etc/init.d/spring-boot-app
}
}
install_double_link_service
()
{
mkdir
/test-service
mv
/spring-boot-launch-script-tests-
*
.jar /test-service/
chmod
+x /test-service/spring-boot-launch-script-tests-
*
.jar
ln
-s
/test-service/spring-boot-launch-script-tests-
*
.jar /test-service/spring-boot-app.jar
ln
-s
/test-service/spring-boot-app.jar /etc/init.d/spring-boot-app
}
start_service
()
{
start_service
()
{
service spring-boot-app start
$@
service spring-boot-app start
$@
}
}
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
View file @
56a58880
...
@@ -32,7 +32,13 @@ WORKING_DIR="$(pwd)"
...
@@ -32,7 +32,13 @@ WORKING_DIR="$(pwd)"
cd
"
$(
dirname
"
$0
"
)
"
||
exit
1
cd
"
$(
dirname
"
$0
"
)
"
||
exit
1
[[
-z
"
$jarfile
"
]]
&&
jarfile
=
$(
pwd
)
/
$(
basename
"
$0
"
)
[[
-z
"
$jarfile
"
]]
&&
jarfile
=
$(
pwd
)
/
$(
basename
"
$0
"
)
while
[[
-L
"
$jarfile
"
]]
;
do
while
[[
-L
"
$jarfile
"
]]
;
do
[[
"
$jarfile
"
=
~ init
\.
d
]]
&&
init_script
=
$(
basename
"
$jarfile
"
)
if
[[
"
$jarfile
"
=
~ init
\.
d
]]
;
then
init_script
=
$(
basename
"
$jarfile
"
)
else
# while looping check if their is any configuration file
configfile
=
"
${
jarfile
%.*
}
.conf"
[[
-r
${
configfile
}
]]
&&
source
"
${
configfile
}
"
fi
jarfile
=
$(
readlink
"
$jarfile
"
)
jarfile
=
$(
readlink
"
$jarfile
"
)
cd
"
$(
dirname
"
$jarfile
"
)
"
||
exit
1
cd
"
$(
dirname
"
$jarfile
"
)
"
||
exit
1
jarfile
=
$(
pwd
)
/
$(
basename
"
$jarfile
"
)
jarfile
=
$(
pwd
)
/
$(
basename
"
$jarfile
"
)
...
@@ -45,7 +51,6 @@ configfile="$(basename "${jarfile%.*}.conf")"
...
@@ -45,7 +51,6 @@ configfile="$(basename "${jarfile%.*}.conf")"
# Initialize CONF_FOLDER location defaulting to jarfolder
# Initialize CONF_FOLDER location defaulting to jarfolder
[[
-z
"
$CONF_FOLDER
"
]]
&&
CONF_FOLDER
=
"{{confFolder:
${
jarfolder
}
}}"
[[
-z
"
$CONF_FOLDER
"
]]
&&
CONF_FOLDER
=
"{{confFolder:
${
jarfolder
}
}}"
# shellcheck source=/dev/null
# shellcheck source=/dev/null
[[
-r
"
${
CONF_FOLDER
}
/
${
configfile
}
"
]]
&&
source
"
${
CONF_FOLDER
}
/
${
configfile
}
"
[[
-r
"
${
CONF_FOLDER
}
/
${
configfile
}
"
]]
&&
source
"
${
CONF_FOLDER
}
/
${
configfile
}
"
...
...
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