diff --git a/hyakvnc b/hyakvnc index 2cf82aa..24eb2f5 100755 --- a/hyakvnc +++ b/hyakvnc @@ -1072,19 +1072,14 @@ function cmd_create { # Preload ORAS images if requested: if [[ "${HYAKVNC_APPTAINER_GHCR_ORAS_PRELOAD:-1}" == 1 ]]; then - local oras_image_path oras_cache_dir + local oras_cache_dir oras_cache_dir="${APPTAINER_CACHEDIR:-${HOME}/.apptainer/cache}/cache/oras" if mkdir -p "${oras_cache_dir}"; then log INFO "Preloading ORAS image for \"${HYAKVNC_APPTAINER_CONTAINER}\"" - oras_image_path="$(ghcr_get_oras_sif "${HYAKVNC_APPTAINER_CONTAINER}" "${APPTAINER_CACHEDIR}/cache/oras" || true)" + ghcr_get_oras_sif "${HYAKVNC_APPTAINER_CONTAINER}" "${APPTAINER_CACHEDIR}/cache/oras" || log ERROR "hyakvnc failed to preload ORAS image for \"${HYAKVNC_APPTAINER_CONTAINER:-}\" on its own. Apptainer will try to download the image by itself. If you don't want to preload ORAS images, use the --no-ghcr-oras-preload option." else log ERROR "Failed to create directory ${oras_cache_dir}." fi - if [[ -n "${oras_image_path:-}" ]]; then - log INFO "Preloaded ORAS image for \"${HYAKVNC_APPTAINER_CONTAINER}\"" - else - log ERROR "hyakvnc failed to preload ORAS image for \"${HYAKVNC_APPTAINER_CONTAINER:-}\" on its own. Apptainer will try to download the image by itself. If you don't want to preload ORAS images, use the --no-ghcr-oras-preload option." - fi fi export HYAKVNC_SLURM_JOB_NAME="${HYAKVNC_SLURM_JOB_PREFIX}${container_name}" @@ -1261,6 +1256,7 @@ function cmd_create { } # Stop trapping the signals: [[ -z "${XNOTRAP:-}" ]] && trap - SIGINT SIGTERM SIGHUP SIGABRT SIGQUIT ERR EXIT + kill -TERM %tail 2>/dev/null # Stop following the SLURM log file return 0 }