Project

General

Profile

Bug #5837

Bug #5836: Insufficient space in 1GB NanoBSD image to upgrade 2.3 snapshots cleanly.

pfSense-upgrade: Make sure it aborts update when pkg calls fail

Added by Renato Botelho over 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Category:
Upgrade
Target version:
Start date:
02/01/2016
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.3
Affected Architecture:

Description

When free space on PKG_CACHEDIR is not enough to download updates, throw an error and exit

Associated revisions

Revision ec337167 (diff)
Added by Renato Botelho over 3 years ago

Save pkg call return code to use on return. The way it is now is always returning 0. It should fix #5837

Revision f1d01c3e (diff)
Added by Renato Botelho over 3 years ago

Fix #5837

Since the introduction of pkg_with_pb(), direct calls to this function
were added using the following format:

if ! pkg_with_pb ... | tee -a $logfile; then

What happened in this case is if was always getting a successfull
return code from tee call, and pkg_with_pb return was always being
ignored leading pfSense-upgrade to keep running when a fatal error
happened.

Since we need to print pkg output and also send it to log, _exec() call
is the best option here.

Added necessary flags to make sure necessary actions (unlock additional
packages or cleaning up kernel package annotation) are executed on
_exit call in fatal cases and replaced all direct calls by _exec()

History

#1 Updated by Renato Botelho over 3 years ago

  • Status changed from Assigned to Feedback
  • % Done changed from 0 to 100

#2 Updated by Renato Botelho over 3 years ago

  • Subject changed from pfSense-upgrade: Detect not enough space available and quit to pfSense-upgrade: Make sure it aborts update when pkg calls fail
  • Status changed from Feedback to Assigned

#3 Updated by Renato Botelho over 3 years ago

  • Status changed from Assigned to Feedback

#4 Updated by Renato Botelho over 3 years ago

  • Status changed from Feedback to Resolved

I was able to simulate the 'out of space' problem and the fixes work as expected

#5 Updated by Chris Buechler about 3 years ago

  • Tracker changed from Feature to Bug

#6 Updated by Chris Buechler about 3 years ago

  • Affected Version set to 2.3

Also available in: Atom PDF