From: Mark Asselstine Date: Thu, 31 May 2018 20:21:45 +0000 (-0400) Subject: templates: actually create DOWNLOAD_TEMP directory X-Git-Tag: lxc-3.1.0~276^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e62213e0294;p=thirdparty%2Flxc.git templates: actually create DOWNLOAD_TEMP directory The way 'mktemp' is currently used you will get a temp directory in $TMPDIR or '/tmp' and DOWNLOAD_TEMP will not be pointing to an actual directory. This will result in the wget operations failing and the container will fail to create: ERROR: Failed to download http://.... Instead we want to use the '-p' option for mktemp to set the base path and this will ensure that the temp directory is created in the correct location and DOWNLOAD_TEMP will be consistent with this location. Signed-off-by: Mark Asselstine --- diff --git a/templates/lxc-download.in b/templates/lxc-download.in index f87518359..5f1138ccf 100644 --- a/templates/lxc-download.in +++ b/templates/lxc-download.in @@ -320,7 +320,7 @@ fi if ! command -V mktemp >/dev/null 2>&1; then DOWNLOAD_TEMP="${DOWNLOAD_TEMP}/tmp/lxc-download.$$" else - DOWNLOAD_TEMP="${DOWNLOAD_TEMP}$(mktemp -d)" + DOWNLOAD_TEMP="$(mktemp -p ${DOWNLOAD_TEMP} -d)" fi # Simply list images