From ebb6ad4cbed19a01baf69085e51f92795fa1c03f Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Wed, 16 Oct 2024 11:30:25 +0300 Subject: [PATCH] Fail when run cmd has non-zero exit code --- sbin/transactional-update.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/transactional-update.in b/sbin/transactional-update.in index e728df0..31faf1b 100755 --- a/sbin/transactional-update.in +++ b/sbin/transactional-update.in @@ -1739,6 +1739,10 @@ if [ -n "${ZYPPER_ARG}" -o ${REWRITE_GRUB_CFG} -eq 1 \ if [ ${DO_RUN} -eq 1 ]; then tukit ${TUKIT_OPTS} call "${SNAPSHOT_ID}" "${RUN_CMD[@]}" |& tee -a ${LOGFILE} 1>&${origstdout} + if [ ${PIPESTATUS[0]} -ne 0 ]; then + log_error "ERROR: ${RUN_CMD[@]} failed!" + EXITCODE=1; + fi set_reboot_level "reboot" fi