From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 23 10:50:03 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C417516A403 for ; Fri, 23 Mar 2007 10:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 88F4B13C465 for ; Fri, 23 Mar 2007 10:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l2NAo3hJ023055 for ; Fri, 23 Mar 2007 10:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l2NAo3qo023054; Fri, 23 Mar 2007 10:50:03 GMT (envelope-from gnats) Resent-Date: Fri, 23 Mar 2007 10:50:03 GMT Resent-Message-Id: <200703231050.l2NAo3qo023054@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Tom Judge Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E37E16A401 for ; Fri, 23 Mar 2007 10:44:13 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB4813C448 for ; Fri, 23 Mar 2007 10:44:13 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2NAiDo4017329 for ; Fri, 23 Mar 2007 10:44:13 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l2NAdBNq015818; Fri, 23 Mar 2007 10:39:11 GMT (envelope-from nobody) Message-Id: <200703231039.l2NAdBNq015818@www.freebsd.org> Date: Fri, 23 Mar 2007 10:39:11 GMT From: Tom Judge To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: misc/110704: gmirror control utility does not exit with correct exit status X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2007 10:50:03 -0000 >Number: 110704 >Category: misc >Synopsis: gmirror control utility does not exit with correct exit status >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 23 10:50:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Tom Judge >Release: 6.2 Release >Organization: >Environment: FreeBSD bunsen.mintel.co.uk 6.2-RELEASE FreeBSD 6.2-RELEASE #2: Tue Mar 20 10:32:46 GMT 2007 root@bob.mintel.co.uk:/usr/obj/usr/src/sys/BUNSEN_BEAKER i386 >Description: When requesting the gmirror status of a non existant device the gmirror utility exits with a 0 exit status which according to the man page indicates that the command completed successfuly. >From man 8 gmirror: EXIT STATUS Exit status is 0 on success, and 1 if the command fails. I would have thought the command has failed if the device of whom the status is being requested does not exist. >How-To-Repeat: Assuming gm0 is not an active gmirror device, and is not listed in the output of "gmirror status" gmirror status gm0; echo $? No such geom: gm0. 0 >Fix: It would seem that the gctl_req structure has members that allow for storing of error states perhapse these could be used in the cases where error conditions are found (std_list, std_status etc...). Or exit(EXIT_FAILURE) could be called. >From sbin/geom/core/geom.c I seems that neither "Class not found" or "No such geom" cause exit(EXIT_FAILURE), where ase "Cannon get GEOM tree" does. >Release-Note: >Audit-Trail: >Unformatted: