Commit f48545bd authored by Andy Wilkinson's avatar Andy Wilkinson

Merge branch '1.5.x'

parents 84c9c7bd 899b8a04
...@@ -207,7 +207,12 @@ public class SysVinitLaunchScriptIT { ...@@ -207,7 +207,12 @@ public class SysVinitLaunchScriptIT {
coloredString(AnsiColor.GREEN, "Running [" + extractPid(output) + "]")); coloredString(AnsiColor.GREEN, "Running [" + extractPid(output) + "]"));
assertThat(output).has( assertThat(output).has(
coloredString(AnsiColor.GREEN, "Stopped [" + extractPid(output) + "]")); coloredString(AnsiColor.GREEN, "Stopped [" + extractPid(output) + "]"));
}
@Test
public void launchWithRelativeLogFolder() throws Exception {
String output = doTest("launch-with-relative-log-folder.sh");
assertThat(output).contains("Log written");
} }
private void doLaunch(String script) throws Exception { private void doLaunch(String script) throws Exception {
......
source ./test-functions.sh
mkdir ./pid
install_service
echo 'LOG_FOLDER=log' > /test-service/spring-boot-app.conf
mkdir -p /test-service/log
start_service
await_app
[[ -s /test-service/log/spring-boot-app.log ]] && echo "Log written"
\ No newline at end of file
source ./test-functions.sh source ./test-functions.sh
mkdir ./pid
install_service install_service
echo 'PID_FOLDER=./pid' > /test-service/spring-boot-app.conf mkdir /test-service/pid
echo 'PID_FOLDER=pid' > /test-service/spring-boot-app.conf
start_service start_service
echo "PID: $(cat /test-service/pid/spring-boot-app/spring-boot-app.pid)" echo "PID: $(cat /test-service/pid/spring-boot-app/spring-boot-app.pid)"
await_app await_app
......
...@@ -52,6 +52,8 @@ configfile="$(basename "${jarfile%.*}.conf")" ...@@ -52,6 +52,8 @@ configfile="$(basename "${jarfile%.*}.conf")"
# Initialize PID/LOG locations if they weren't provided by the config file # Initialize PID/LOG locations if they weren't provided by the config file
[[ -z "$PID_FOLDER" ]] && PID_FOLDER="{{pidFolder:/var/run}}" [[ -z "$PID_FOLDER" ]] && PID_FOLDER="{{pidFolder:/var/run}}"
[[ -z "$LOG_FOLDER" ]] && LOG_FOLDER="{{logFolder:/var/log}}" [[ -z "$LOG_FOLDER" ]] && LOG_FOLDER="{{logFolder:/var/log}}"
! [[ "$PID_FOLDER" == /* ]] && PID_FOLDER="$(dirname "$jarfile")"/"$PID_FOLDER"
! [[ "$LOG_FOLDER" == /* ]] && LOG_FOLDER="$(dirname "$jarfile")"/"$LOG_FOLDER"
! [[ -x "$PID_FOLDER" ]] && PID_FOLDER="/tmp" ! [[ -x "$PID_FOLDER" ]] && PID_FOLDER="/tmp"
! [[ -x "$LOG_FOLDER" ]] && LOG_FOLDER="/tmp" ! [[ -x "$LOG_FOLDER" ]] && LOG_FOLDER="/tmp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment