On Mon, Nov 9, 2009 at 12:03 PM, John Mendenhall <j...@surfutopia.net> wrote:
>> On Mon, Nov 9, 2009 at 2:19 PM, John Mendenhall <j...@surfutopia.net>
wrote:
>> > I have several openbsd 4.4 boxes, all of which are running
>> > spamd.  I have a cron job which runs a script, which has the
>> > following commands in it:
>>
>> Well, sort is obviously calling fwrite to write on stdout, which
>> head reads.  When head has had enough, it closes its input,
>> which is from the pipe.  fwrite then terminates with an EPIPE
>> error, which sort is not (seemingly) handling properly.  (Looks
>> like it is calling warn(3) or err(3).)  Maybe sort(3) is not complaining
>> if  isatty(fileno(stdout)).  Only the source knows for sure.

Not quite.  cron is invoking programs with SIGPIPE ignored, thus the
reported behavior from sort.  I don't see this (the ignoring) on the
other systems I have access to and don't see anything in the standard
that would call for that, so I think this is a bug in our cron.  I
encourage the OP to use sendbug to submit a report for this so we
don't lose track of it.


>> The mystery to me is why the error message does not appear
>> when the pipe is run on a tty.  (I can duplicate your error easily).

Because it gets SIGPIPE and exits quietly.


Philip Guenther

Reply via email to