Re: Persistent connection to named pipe

2010-07-16 Thread Tom Metro
Michael ODonnell wrote: ...tail -f...I have yet to see any output when used on the RHEL3 system where I actually need to do the filtering. Try -F. Quoting tail(1): -F same as --follow=name --retry --retry keep trying to open a file even when it is or becomes inaccessible;

Persistent connection to named pipe

2010-07-14 Thread Michael ODonnell
Some years back I created a little FIFO-reader utility that can be used to relay data via a named pipe (FIFO) such that it keeps the output end of the FIFO open despite multiple opens/closes of the input end by one or more writers. This is necessary because the naive approach only works once, as

Re: Persistent connection to named pipe

2010-07-14 Thread Ken D'Ambrosio
Well... interesting. I wonder why cat acts that way. Interestingly, I'd played around with FIFOs some time ago, and there's a fine way to cheat: tail -f. k...@minastirith:~$ mknod /tmp/FIFO p k...@minastirith:~$ tail -f /tmp/FIFO /tmp/FIFO.log [1] 13082 k...@minastirith:~$ date /tmp/FIFO

Re: Persistent connection to named pipe

2010-07-14 Thread Kevin D. Clark
Michael ODonnell writes: I'm now working with a cantankerous old app that can't easily be modified and it'd be handy to have multiple sequential invocations of that app each spew some logging data into a FIFO (without blocking) so it could be processed by a single persistent instance of a

Re: Persistent connection to named pipe

2010-07-14 Thread Michael ODonnell
Ken wrote: Well... interesting. I wonder why cat acts that way. IIRC a read() of the FIFO when all data have been consumed and the writer has closed his end yields -1 with errno EAGAIN and most apps just call it quits at that point. Interestingly, I'd played around with FIFOs some time

Re: Persistent connection to named pipe

2010-07-14 Thread Michael ODonnell
Interestingly, I'd played around with FIFOs some time ago, and there's a fine way to cheat: tail -f. D'oh!!! It might be coming back to me now, why I didn't use the tail -f trick Way Back When; although it appears to work as expected with a FIFO on a CentOS5.4 box I have yet to see any