>>>>> "MT" == Mikhail Teterin writes: MT> On четвер 20 грудень 2007, Max N. Boyarov wrote: MT> = after something writeln to /var/log/messages tail get SIGPIPE
Advertising
MT> But why is that needed for tail to notice? It is trying to output 10 lines. MT> After it outputs the very first one of them, awk exits, and the 9 subsequent MT> lines go into thin air /without tail noticing/. MT> Is not that a bug in itself? Tail write buffer at all, i.e. all 10 lines writes to pipe. $ cat test line1 line2 line3 line4 line5 line6 line7 line8 line9 line10 line11 tail -f test | awk '{print "Exiting" $1; exit 0}' open("test", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=68, ...}) = 0 syscall_477(0, 0x44, 0x1, 0x1, 0x3, 0, 0) = 0x28175000 write(1, "line2\nline3\nline4\nline5\nline6\nli"..., 62Exitingline2 ) = 62 fstat(3, {st_mode=S_ISUID|S_ISVTX|070, st_size=0, ...}) = 0 syscall_478(0x3, 0, 0, 0x1) = 0 syscall_478(0x3, 0, 0, 0) = 0 read(3, "line1\nline2\nline3\nline4\nline5\nli"..., 4096) = 68 ^^^^^^^^^^^^^^^^^^^^^^ write buff ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ munmap(0x28175000, 68) = 0 read(3, "", 4096) = 0 kqueue(0x28172d40) = 4 syscall_397(0x3, 0xbfbfe44c) = 0 kevent(0x4, 0x28205040, 0x1, 0, 0, 0xbfbfe624) = 0 kevent(0x4, 0, 0, 0x28205040, 0x1, 0) = 1 read(3, "line++\n", 4096) = 7 ^^^^^^^^^^^^^^^^^^^^^^ new line added ^^^^^^^^^^^^^^^^^^^^^ fstat(1, {st_mode=031545, st_size=7596457873570623081, ...}) = 0 read(3, "", 4096) = 0 write(1, "line++\n", 7) = -1 EPIPE (Broken pipe) ^^^^^^^^^ try write ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- SIGPIPE (Broken pipe: 13) --- --- SIGPIPE (Broken pipe: 13) --- ^^^^^^^^ exit ^^^^^^^^^^^^^ -- Max N. Boyarov
pgpQlaBQK0jet.pgp
Description: PGP signature