Allow LOG_FOLDER and PID_FOLDER defaults to be set at build time
This commit enhances the default launch script to allow the default values for LOG_FOLDER and PID_FOLDER to be set at build time. They can now be set using the logFolder and pidFolder properties respectively. Closes gh-4787
This commit is contained in:
@@ -46,8 +46,8 @@ configfile="$(basename "${jarfile%.*}.conf")"
|
||||
[[ -r "${jarfolder}/${configfile}" ]] && source "${jarfolder}/${configfile}"
|
||||
|
||||
# Initialize PID/LOG locations if they weren't provided by the config file
|
||||
[[ -z "$PID_FOLDER" ]] && PID_FOLDER="/var/run"
|
||||
[[ -z "$LOG_FOLDER" ]] && LOG_FOLDER="/var/log"
|
||||
[[ -z "$PID_FOLDER" ]] && PID_FOLDER="{{pidFolder:/var/run}}"
|
||||
[[ -z "$LOG_FOLDER" ]] && LOG_FOLDER="{{logFolder:/var/log}}"
|
||||
! [[ -x "$PID_FOLDER" ]] && PID_FOLDER="/tmp"
|
||||
! [[ -x "$LOG_FOLDER" ]] && LOG_FOLDER="/tmp"
|
||||
|
||||
|
||||
@@ -76,6 +76,16 @@ public class DefaultLaunchScriptTests {
|
||||
assertThatPlaceholderCanBeReplaced("useStartStopDaemon");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void logFolderCanBeReplaced() throws Exception {
|
||||
assertThatPlaceholderCanBeReplaced("logFolder");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pidFolderCanBeReplaced() throws Exception {
|
||||
assertThatPlaceholderCanBeReplaced("pidFolder");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void defaultForUseStartStopDaemonIsTrue() throws Exception {
|
||||
DefaultLaunchScript script = new DefaultLaunchScript(null, null);
|
||||
|
||||
Reference in New Issue
Block a user