Richie
2010-May-15 04:16 UTC
[Xen-devel] [PATCH] xend: update init script to avoid grep on non-existent file system
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. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2010-May-15 07:35 UTC
Re: [Xen-devel] [PATCH] xend: update init script to avoid grep on non-existent file system
On 15/05/2010 05:16, "Richie" <listmail@triad.rr.com> 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@lists.xensource.com http://lists.xensource.com/xen-devel
Richie
2010-May-15 14:56 UTC
Re: [Xen-devel] [PATCH] xend: update init script to avoid grep on non-existent file system
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@triad.rr.com> 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@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2010-May-15 15:11 UTC
Re: [Xen-devel] [PATCH] xend: update init script to avoid grep on non-existent file system
On 15/05/2010 15:56, "Richie" <listmail@triad.rr.com> wrote:> > 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.Well, it''s a Linux-specific hotplug script thet you''re editing, isn''t it. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Richie
2010-May-15 16:00 UTC
Re: [Xen-devel] [PATCH] xend: update init script to avoid grep on non-existent file system
Keir Fraser wrote:> On 15/05/2010 05:16, "Richie" <listmail@triad.rr.com> 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@lists.xensource.com http://lists.xensource.com/xen-devel