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 committed 2019-08-12 17:56:17 -04:00
1 parent 0588b6f161
commit 925c6c4c28
15 files changed
+16 -15

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ add_keys() {
[[ "$1" == "$cmd" ]] && shift 1
declare NAME="$1" KEY_FILE="$2"
local TMP_KEY_FILE
TMP_KEY_FILE=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
TMP_KEY_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXX")
trap "rm -rf '$TMP_KEY_FILE' >/dev/null" RETURN INT TERM EXIT
if [[ -n "$KEY_FILE" ]]; then