From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richie Subject: Re: [PATCH] xend: update init script to avoid grep on non-existent file system Date: Sat, 15 May 2010 10:56:00 -0400 Message-ID: <4BEEB600.4090906@triad.rr.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen Devel List-Id: xen-devel@lists.xenproject.org Sure. I agree much simpler, but is this blurb in the grep manpage a conce= rn? -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=92s -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=20 linux, thus implying (modern?) GNU grep? The reason I am bringing this=20 up is that I recall having grep related issues when running git on=20 Solaris (without gnu utilities installed) for this very reason. I will=20 re-sumbit accordingly. Keir Fraser wrote: > On 15/05/2010 05:16, "Richie" wrote: > > =20 >> 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 moun= t >> as appropriate, but then it does a grep on /proc/xen/capabilities >> without ensuring that /proc/xen is actually mounted. This is my attem= pt >> (read: first patch :) ) to avoid it. >> =20 > > Richie, > > Can you try adding the -s option to grep instead (i.e., grep -qs)? Shou= ld be > a simpler way to achieve the same thing. I'll apply that instead if it = works > okay for you. > > -- Keir > > > =20