From nobody@FreeBSD.org  Sun Jan 15 00:23:14 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2777A106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 15 Jan 2012 00:23:14 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 11D8E8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 15 Jan 2012 00:23:14 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0F0NDC6086955
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 15 Jan 2012 00:23:13 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q0F0NDQI086949;
	Sun, 15 Jan 2012 00:23:13 GMT
	(envelope-from nobody)
Message-Id: <201201150023.q0F0NDQI086949@red.freebsd.org>
Date: Sun, 15 Jan 2012 00:23:13 GMT
From: John Sellens <jsellens@syonex.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: freebsd-update does not check for failed install commands
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         164131
>Category:       bin
>Synopsis:       freebsd-update(8) does not check for failed install commands
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    cperciva
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 15 00:30:11 UTC 2012
>Closed-Date:    
>Last-Modified:  Thu Jan 19 17:44:37 UTC 2012
>Originator:     John Sellens
>Release:        9.0-RELEASE
>Organization:
>Environment:
FreeBSD aim2.aimtechglobal.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
In freebsd-update the shell function install_from_index does not appear to check whether the install command succeeds or fails (this seems to apply in other functions as well).

If there is a write error (e.g. file system full) the update process fails but freebsd-update says "go ahead and continue", so you can end up with a corrupted or unbootable system.

I was updating from an 8.x system, with a too small / partition.  Since the 9.0 (and default 8.x I think) amd64 kernels seem to have debugging/symbols enabled, they are larger than kernels used to be.  So my / partition filled up when freebsd-update was installing the kernel.  But it told me to continue right on and reboot, which would have failed.

/: write failed, filesystem is full
install: ///boot/INS@zUqD: No space left on device
install: ///boot/userboot.so: No space left on device
install: ///boot/INS@R4jN: No space left on device
install: ///boot/INS@5aZb: No space left on device
rmdir: ///boot/kernel: Directory not empty

/: write failed, filesystem is full

/: write failed, filesystem is full

/: write failed, filesystem is full

Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
#  echo $status
0

>How-To-Repeat:
Have a too small (or too full) / partition and update to a new release on amd64, and watch it fail.
>Fix:
I suspect someone needs to go through the freebsd-update script and check for failing commands (and I'm sorry, but I'm not currently able to do that).


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cperciva 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jan 19 17:44:25 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164131 
>Unformatted:
