You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change the ownership of the pid folder when using a sub-folder
This is an alternative to the fix made in 3b52909 which removed the
chown call entirely.
Prior to 3b52909, the ownership of $PID_FOLDER was always changed even
when its value was /var/run. This was problematic as it could prevent
other services from creating their pid folder or file.
When a sub-folder is used, changing its ownership so that it’s owned by
the user that will run the app is desirable as it limits access to the
folder. Rather than removing the chown call entirely, this commit
ensures that it only happens when a sub-folder is being used to hold the
pid file.
Closesgh-6532
Copy file name to clipboardExpand all lines: spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,7 @@ fi
106
106
# Build the pid and log filenames
107
107
if [[ "$identity"=="$init_script" ]] || [[ "$identity"=="$APP_NAME" ]];then
108
108
PID_FOLDER="$PID_FOLDER/${identity}"
109
+
pid_subfolder=$PID_FOLDER
109
110
fi
110
111
pid_file="$PID_FOLDER/${identity}.pid"
111
112
log_file="$LOG_FOLDER/$LOG_FILENAME"
@@ -143,6 +144,9 @@ do_start() {
143
144
mkdir "$PID_FOLDER"&> /dev/null
144
145
if [[ -n"$run_user" ]];then
145
146
checkPermissions ||return$?
147
+
if [[ -z"$pid_subfolder" ]];then
148
+
chown "$run_user""$pid_subfolder"
149
+
fi
146
150
chown "$run_user""$pid_file"
147
151
chown "$run_user""$log_file"
148
152
if [ $USE_START_STOP_DAEMON=true ] &&type start-stop-daemon > /dev/null 2>&1;then
0 commit comments