I am starting following command from a bash script (arguments omitted for simplicity)
avconv | sox | nc
I am starting about 150 such commands on the same box at the same time.
The last nc command sends the stream to another host. When that host dies, nc dies but avconv and sox can stay alive. When I then killall sox in this situation, avconv stays alive.
Should there not be a sigpipe?
When I execute the bash script manually and nc dies, the other two processes die too. But not when I start many such scripts .
Is it possible that sigpipe does not work when pipe buffers are full or the system is otherwise highly contended? How can I work around it?
ncprogram goes away, thesoxprogram will only get asigpipewhen thesoxtries to write some data to the pipe. Sosoxneeds to be outputting data.soxprobably buffers output, so it might need to output several thousand characters before it actually tries to push the data through the pipe.avconv | sox | check-data-flow-or-kill-parent | nckillall avconvsolve your problem? If avconv goes away then sox will get eof on its input, and probably will exit, then nc will get eof...