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
4a222cb4
Commit
4a222cb4
authored
Oct 04, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Log a warning when using fallback for pid and log locations"
Closes gh-14519
parent
3f894cbe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
launch.script
...urces/org/springframework/boot/loader/tools/launch.script
+2
-2
SysVinitLaunchScriptIT.java
...ngframework/boot/launchscript/SysVinitLaunchScriptIT.java
+16
-1
launch-with-missing-log-folder.sh
.../test/resources/scripts/launch-with-missing-log-folder.sh
+6
-0
launch-with-missing-pid-folder.sh
.../test/resources/scripts/launch-with-missing-pid-folder.sh
+6
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
View file @
4a222cb4
...
@@ -67,8 +67,8 @@ echoYellow() { echo $'\e[0;33m'"$1"$'\e[0m'; }
...
@@ -67,8 +67,8 @@ echoYellow() { echo $'\e[0;33m'"$1"$'\e[0m'; }
[[
-z
"
$LOG_FOLDER
"
]]
&&
LOG_FOLDER
=
"{{logFolder:/var/log}}"
[[
-z
"
$LOG_FOLDER
"
]]
&&
LOG_FOLDER
=
"{{logFolder:/var/log}}"
!
[[
"
$PID_FOLDER
"
==
/
*
]]
&&
PID_FOLDER
=
"
$(
dirname
"
$jarfile
"
)
"
/
"
$PID_FOLDER
"
!
[[
"
$PID_FOLDER
"
==
/
*
]]
&&
PID_FOLDER
=
"
$(
dirname
"
$jarfile
"
)
"
/
"
$PID_FOLDER
"
!
[[
"
$LOG_FOLDER
"
==
/
*
]]
&&
LOG_FOLDER
=
"
$(
dirname
"
$jarfile
"
)
"
/
"
$LOG_FOLDER
"
!
[[
"
$LOG_FOLDER
"
==
/
*
]]
&&
LOG_FOLDER
=
"
$(
dirname
"
$jarfile
"
)
"
/
"
$LOG_FOLDER
"
!
[[
-x
"
$PID_FOLDER
"
]]
&&
echoYellow
"
Warning: PID_FOLDER=
$PID_FOLDER
does not exists fall
back to /tmp"
&&
PID_FOLDER
=
"/tmp"
!
[[
-x
"
$PID_FOLDER
"
]]
&&
echoYellow
"
PID_FOLDER
$PID_FOLDER
does not exist. Falling
back to /tmp"
&&
PID_FOLDER
=
"/tmp"
!
[[
-x
"
$LOG_FOLDER
"
]]
&&
echoYellow
"
Warning: LOG_FOLDER=
$LOG_FOLDER
does not exists fall
back to /tmp"
&&
LOG_FOLDER
=
"/tmp"
!
[[
-x
"
$LOG_FOLDER
"
]]
&&
echoYellow
"
LOG_FOLDER
$LOG_FOLDER
does not exist. Falling
back to /tmp"
&&
LOG_FOLDER
=
"/tmp"
# Set up defaults
# Set up defaults
[[
-z
"
$MODE
"
]]
&&
MODE
=
"{{mode:auto}}"
# modes are "auto", "service" or "run"
[[
-z
"
$MODE
"
]]
&&
MODE
=
"{{mode:auto}}"
# modes are "auto", "service" or "run"
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java
View file @
4a222cb4
...
@@ -171,7 +171,22 @@ public class SysVinitLaunchScriptIT {
...
@@ -171,7 +171,22 @@ public class SysVinitLaunchScriptIT {
@Test
@Test
public
void
basicLaunch
()
throws
Exception
{
public
void
basicLaunch
()
throws
Exception
{
doLaunch
(
"basic-launch.sh"
);
String
output
=
doTest
(
"basic-launch.sh"
);
assertThat
(
output
).
doesNotContain
(
"PID_FOLDER"
);
}
@Test
public
void
launchWithMissingLogFolderGeneratesAWarning
()
throws
Exception
{
String
output
=
doTest
(
"launch-with-missing-log-folder.sh"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
YELLOW
,
"LOG_FOLDER /does/not/exist does not exist. Falling back to /tmp"
));
}
@Test
public
void
launchWithMissingPidFolderGeneratesAWarning
()
throws
Exception
{
String
output
=
doTest
(
"launch-with-missing-pid-folder.sh"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
YELLOW
,
"PID_FOLDER /does/not/exist does not exist. Falling back to /tmp"
));
}
}
@Test
@Test
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-missing-log-folder.sh
0 → 100755
View file @
4a222cb4
source
./test-functions.sh
install_service
echo
'LOG_FOLDER=/does/not/exist'
>
/test-service/spring-boot-app.conf
start_service
await_app
curl
-s
http://127.0.0.1:8080/
spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-missing-pid-folder.sh
0 → 100755
View file @
4a222cb4
source
./test-functions.sh
install_service
echo
'PID_FOLDER=/does/not/exist'
>
/test-service/spring-boot-app.conf
start_service
await_app
curl
-s
http://127.0.0.1:8080/
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