Commit 826acf5d authored by Andy Wilkinson's avatar Andy Wilkinson

Set the working directory to that of the jar when using start-stop-daemon

By default, start-stop-daemon will chdir to the root directory before
starting the process. This prevents an application.properties file that
sits alongside the jar from being found.

This commit updates the call to start-stop-daemon to use --chdir to
set the working directory to that of the jar that’s being launched.

Closes gh-4281
parent 9a7baf19
......@@ -122,7 +122,8 @@ start() {
}
do_start() {
pushd $(dirname "$jarfile") > /dev/null
working_dir=$(dirname "$jarfile")
pushd "$working_dir" > /dev/null
if [[ -n "$run_user" ]]; then
mkdir "$PID_FOLDER" &> /dev/null
checkPermissions || return $?
......@@ -136,6 +137,7 @@ do_start() {
--make-pidfile --pidfile $pid_file \
--background --no-close \
--startas $javaexe \
--chdir "$working_dir"
-- \
-Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS \
-jar $jarfile $RUN_ARGS "$@" \
......
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