feat: inject the dokku PID into temporary files/directories

This will allow background processes to cleanup these files if they were unable to be cleaned up during a run of the dokku binary, as is the case for files copied by the docker binary when running in docker.
This commit is contained in:
Jose Diaz-Gonzalez
2019-08-12 17:56:17 -04:00
parent 0588b6f161
commit 925c6c4c28
15 changed files with 16 additions and 15 deletions

View File

@@ -71,7 +71,7 @@ generate_scale_file() {
if [[ ! -f $DOKKU_SCALE_FILE ]]; then
dokku_log_info1_quiet "DOKKU_SCALE file not found in app image. Generating one based on Procfile..."
local GENERATE_SCALE_FILE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
local GENERATE_SCALE_FILE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXX")
trap "rm -rf '$GENERATE_SCALE_FILE_TMP_WORK_DIR' >/dev/null" RETURN
if [[ -f $DOKKU_PROCFILE ]]; then