Don't change ownership of PID_FOLDER

Update the launch script so that it no longer changes ownership of the
PID_FOLDER.

Commit b24e736cfe had changed the chown
line from:
	chown "$run_user" "$PID_FOLDER/${identity}"
to:
	chown "$run_user" "$PID_FOLDER"

This meant that it was possible for the launch script to change
ownership of `/var/run` and prevent later processes from writing to
the folder.

Since PID_FOLDER is created before the chown statement, and that
the `checkPermissions` function runs to ensure that the PID file can
be written, it appears that the chown is not even required.

Fixes gh-6532
pull/7002/head
Phillip Webb 8 years ago
parent b97e0bd471
commit 3b52909fc2

@ -143,7 +143,6 @@ do_start() {
mkdir "$PID_FOLDER" &> /dev/null mkdir "$PID_FOLDER" &> /dev/null
if [[ -n "$run_user" ]]; then if [[ -n "$run_user" ]]; then
checkPermissions || return $? checkPermissions || return $?
chown "$run_user" "$PID_FOLDER"
chown "$run_user" "$pid_file" chown "$run_user" "$pid_file"
chown "$run_user" "$log_file" chown "$run_user" "$log_file"
if [ $USE_START_STOP_DAEMON = true ] && type start-stop-daemon > /dev/null 2>&1; then if [ $USE_START_STOP_DAEMON = true ] && type start-stop-daemon > /dev/null 2>&1; then

Loading…
Cancel
Save