WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] xend: update init script to avoid grep on non-ex

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xend: update init script to avoid grep on non-existent file system
From: Richie <listmail@xxxxxxxxxxxx>
Date: Sat, 15 May 2010 10:56:00 -0400
Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 15 May 2010 07:57:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C8140D61.145AC%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C8140D61.145AC%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Sure. I agree much simpler, but is this blurb in the grep manpage a concern?
-s, --no-messages
Suppress error messages about nonexistent or unreadable files.
Portability note: unlike GNU grep, 7th Edition Unix grep did not
conform to POSIX, because it lacked -q and its -s option behaved
like GNU grep’s -q option. USG-style grep also lacked -q but
its -s option behaved like GNU grep. *Portable shell scripts
should avoid both -q and -s and should redirect standard and
error output to /dev/null instead*. (-s is specified by POSIX.)

I'm not sure where all the xend daemon can run? is it always running on linux, thus implying (modern?) GNU grep? The reason I am bringing this up is that I recall having grep related issues when running git on Solaris (without gnu utilities installed) for this very reason. I will re-sumbit accordingly.


Keir Fraser wrote:
On 15/05/2010 05:16, "Richie" <listmail@xxxxxxxxxxxx> wrote:

I'm seeing a grep error during bare metal pvops kernel boot.  In the
init script, the previous checks will avoid/perform the /proc/xen mount
as appropriate, but then it does a grep on /proc/xen/capabilities
without ensuring that /proc/xen is actually mounted.  This is my attempt
(read: first patch :) ) to avoid it.

Richie,

Can you try adding the -s option to grep instead (i.e., grep -qs)? Should be
a simpler way to achieve the same thing. I'll apply that instead if it works
okay for you.

 -- Keir




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel