[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#673328: live-installer does not preserve /var/log; breaks freeradius



retitle 673328 fix live-installer to properly detect errors during tar extraction
thanks

On Thu, 06 Dec 2012, Raphael Hertzog wrote:
> I had a similar problem and it's probably the same as #652946.

So instead of reassigning it and merging it, we will repurpose
this bug to track the problem that live-installer sometimes
doesn't detect the underlying tar failure and lets the installation
proceed while in fact not all files have been copied.

The problem lies somewhere in this bit of code:

		exec 4>&0
                tar c . | \
                (chdir /target && tar xv) | \
                (
                        while read line; do
                                COUNT=$(($COUNT + 1))
                                CURRENT=$(($COUNT * 100 / $STEPS))

                                [ x$CURRENT = x$LAST_UPDATE ] && continue

                                LAST_UPDATE=$CURRENT
                                db_progress STEP 1 <&4
                        done
                )
                exec 0>&4

The exit code of the pipeline is the one of the last command, i.e. the big
parenthese. So maybe we could add a check after the loop to verify that
$COUNT >= $STEPS and exit with an error code otherwise ?

		[ $COUNT -ge $STEPS ] || exit 1

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/


Reply to: