Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2002 13:13:12 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        George Georgalis <george@galis.org>
Cc:        nbari@unixmexico.com, freebsd-isp@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: tail -f <file> on webpage
Message-ID:  <20021210191312.GG48182@dan.emsphone.com>
In-Reply-To: <20021210185212.GC23550@trot.local>
References:  <26647.148.243.211.1.1039409754.squirrel@mail.unixmexico.com> <20021209054521.GB20704@dan.emsphone.com> <20021210185212.GC23550@trot.local>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Dec 10), George Georgalis said:
> On Sun, Dec 08, 2002 at 11:45:22PM -0600, Dan Nelson wrote:
> > #! /bin/sh
> > printf "Content-type: text/plain\r\n\r\n"
> > tail -f /var/log/messages
> >
> 
> Unfortunatly if you try that your webserver will quickly fail because
> the connection never closes. If your customers can create cgi scripts
> they can bring down your server too.
> 
> How fast depends on httpd.conf MaxSpareServers, and how quickly you
> hit reload.

The connection does close, but it looks like tail does not correctly
exit:

kevent(0x4,0x0,0x0,0xbfbff410,0x1,0x0)           = 1 (0x1)
read(0x3,0x804d000,0x2000)                       = 90 (0x5a)
read(0x3,0x804d000,0x2000)                       = 0 (0x0)
write(1,0x804f000,90)                            ERR#32 'Broken pipe'
kevent(0x4,0x0,0x0,0xbfbff410,0x1,0x0)           = 1 (0x1)
read(0x3,0x804d000,0x2000)                       = 85 (0x55)
read(0x3,0x804d000,0x2000)                       = 0 (0x0)
write(1,0x804f000,85)                            ERR#32 'Broken pipe'
kevent(0x4,0x0,0x0,0xbfbff410,0x1,0x0)           = 1 (0x1)
read(0x3,0x804d000,0x2000)                       = 34 (0x22)
read(0x3,0x804d000,0x2000)                       = 0 (0x0)
write(1,0x804f000,34)                            ERR#32 'Broken pipe'

Not sure why though.  The error-checking code in tail looks fine.

-- 
	Dan Nelson
	dnelson@allantgroup.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021210191312.GG48182>