]> git.proxmox.com Git - mirror_lxc.git/commitdiff
templates: actually create DOWNLOAD_TEMP directory
authorMark Asselstine <mark.asselstine@windriver.com>
Thu, 31 May 2018 20:21:45 +0000 (16:21 -0400)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 1 Jun 2018 14:45:26 +0000 (16:45 +0200)
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 <mark.asselstine@windriver.com>
templates/lxc-download.in

index f87518359daa2fd11c6a8cdbc542c704bdb2c95b..5f1138ccf2acbcdd8a27d6a2e0e542c1411b4ede 100644 (file)
@@ -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