diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2019-04-13 07:45:07 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2019-08-11 08:48:22 +0000 |
commit | f01ccfd1af6e1daed01fa028336b3b5d27f888f3 (patch) | |
tree | b7f59865cb9ecb9977a124fe96bac73f9c15397d | |
parent | Cosmetically fixing internal preseed file when using the progress-linux package. (diff) | |
download | compute-tools-f01ccfd1af6e1daed01fa028336b3b5d27f888f3.tar.xz compute-tools-f01ccfd1af6e1daed01fa028336b3b5d27f888f3.zip |
Simplifying trap handling in debconf container create script.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | share/scripts/debconf | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf index 67904c0..f3632f4 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -126,7 +126,7 @@ then exit 1 fi -Start () +Mount () { # Mounting rw bind mounts if [ -n "${BIND}" ] @@ -182,12 +182,9 @@ Start () mount -t overlay overlay-${NAME} -olowerdir="${DIRECTORY_LOWER}",upperdir="${DIRECTORY_UPPER}",workdir="${DIRECTORY_WORK}" "${DIRECTORY_MERGED}" done fi - - # Trap function - trap 'Stop' EXIT HUP INT QUIT TERM } -Stop () +Umount () { # Unmounting overlay mounts if [ -n "${CNT_OVERLAY}" ] @@ -1082,6 +1079,9 @@ Commands () esac } +# Trap function +trap 'Umount' EXIT HUP INT QUIT TERM + umask 0022 export NAME @@ -1129,7 +1129,7 @@ Cleanup_system "${CACHE}/${DISTRIBUTION}_${ARCHITECTURE}" mkdir -p "${MACHINES}" cp -a "${CACHE}/${DISTRIBUTION}_${ARCHITECTURE}" "${MACHINES}/${NAME}" -Start +Mount Configure_system "${MACHINES}/${NAME}" Configure_network "${MACHINES}/${NAME}" @@ -1138,8 +1138,6 @@ Cleanup_system "${MACHINES}/${NAME}" Commands "${MACHINES}/${NAME}" -Stop - # remove debconf temporary files rm --preserve-root --one-file-system -rf "${DEBCONF_TMPDIR}" rmdir --ignore-fail-on-non-empty "/tmp/${SOFTWARE}" 2>&1 || true |