[WBEL-users] bash causes sporadic job control output

Kirby Bohling kbohling@birddog.com
Tue, 20 Jul 2004 16:34:24 -0500


On Tue, Jul 20, 2004 at 02:49:54PM -0600, Alan Sparks wrote:
> Ok, so "-v" or not.  A cut/paste a little out of sync.  Doesn't matter, 
> same result no matter what I put in there.
> The code runs perfectly on RH 7.2, FC2, and Solaris with a bash shell.
> And no, /opt/sendmail/mailq is Sendmail code, not a script.  And it's 
> working fine too, I've checked that very carefully.
> -Alan

	I'm not sure because it's e-mail, but I read that like your
annoyed with me for questioning details.  You might have started 24
hours ago, but I just saw this 30 minutes ago.  It'd help more if
you'd say what you tried if only just a summary.

	You're running what appears to be a non-WBEL version of
Sendmail, and saying that running a shell script and piping into
head doesn't work.  I've found that normally, it's best to eliminate
other possibilities before assuming that /bin/bash or head have a
bug.

	I'm not trying to be snippy, but when you post that /bin/bash
and/or head don't work the details sorta matter.  I've seen lots of
odd ball problems end up being, a pathing issue, a mis-escaped
argument, or think you are running a binary, when you are really
running a shell script that is a wrapper for a binary.  I'm just
trying to eliminate those.  Generally, that's more likely then a bug
in the piping code in "bash" IMHO.

	I run head and bash a lot.  I'd like to think they work.  As you
well know, it's the details that give you the clues to the
problem...  My paycheck depends on those utilities working, so you
have my full attention.  I'd really like to know what is going on.

	I've taken the output of "mailq" from a RH7.1 machine,
duplicated it enough times so that there's 1.4 million lines of
data, then I run this:

foo.sh | head, where foo.sh has this for contents:

#!/bin/sh

cat mailq.tmp \
        | perl -n -e '/^\s+\<.*\@(.*)\>/ && print "$1\n"' \
        | sort \
        | uniq -c \
        | sort -nr

mailq.tmp has the 1.4 Million lines on it.

	I run it thru head on my desktop WBEL3.0 while fully updated
machine, without a problem.  No SIGPIPE, no nothing, just the output
you'd expect.  Everything runs like a champ.  For whatever that
knowledge is worth.

	I can't duplicate your problem.  You can easily see if you can
duplicate my results and see if they come out the same.  If they
don't match, I'd start from a fresh WBEL install my machine is
completely stock, I just use it to SSH to other machines.

	I get the impression I'm just irritating you.  So good luck, and
report back if you figure it out.

Hope this helps,
	Kirby


> 
> Kirby Bohling wrote:
> >On Tue, Jul 20, 2004 at 10:29:19AM -0600, Alan Sparks wrote:
> >
> ><snip...>
> >
> >>/home/asparks/bin/mtabacklog: line 7:  3810 Done                   
> >>mailq -v
> >>     3811                       | perl -n -e '/^\s+\<.*\@(.*)\>/ &&
> >>print "$1\n"'
> >>     3812                       | sort
> >>     3813                       | uniq -c
> >>     3814 Broken pipe             | sort -nr
> >>
> >
> ><snip...>
> >
> >Something isn't correct.  You either aren't running what you think
> >you are, or there is a cut and paste gone bad....
> >
> >Your above command says "3810 Done mailq -v"
> >
> >However, your script doesn't runs "mailq", not "mailq -v".  So now
> >I'm worried about that then I am about anything else.  Either you
> >aren't posting exactly what you are running, or you aren't running
> >what you think you are.  Finally, why is "mailq -v" on line 7?  The
> >script you posted has "mailq" on the second line?
> >
> >Is "/opt/sendmail/mailq" a script by chance?
> >
> >	Thanks,
> >		Kirby
> >
> >
> >>====== the script for reference =====
> >>#!/bin/sh
> >>/opt/sendmail/mailq \
> >>       | perl -n -e '/^\s+\<.*\@(.*)\>/ && print "$1\n"' \
> >>       | sort \
> >>       | uniq -c \
> >>       | sort -nr
> >>
> >>
> >>-- 
> >>Alan Sparks, Sr. UNIX Administrator	asparks@quris.com
> >>Quris, Inc.				(720) 836-2058
> >>
> >>_______________________________________________
> >>Whitebox-users mailing list
> >>Whitebox-users@beau.org
> >>http://beau.org/mailman/listinfo/whitebox-users
> >>
> 
> 
> -- 
> Alan Sparks, Sr. UNIX Administrator	asparks@quris.com
> Quris, Inc.				(720) 836-2058
> _______________________________________________
> Whitebox-users mailing list
> Whitebox-users@beau.org
> http://beau.org/mailman/listinfo/whitebox-users
>