From owner-freebsd-questions Tue Dec 8 13:09:37 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA10231 for freebsd-questions-outgoing; Tue, 8 Dec 1998 13:09:37 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from hera.webcom.com (hera.webcom.com [209.1.28.42]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA10226 for ; Tue, 8 Dec 1998 13:09:36 -0800 (PST) (envelope-from graeme@echidna.com) Received: from eresh.webcom.com (eresh.webcom.com [209.1.28.49]) by hera.webcom.com (8.9.1/8.9.1) with SMTP id UAA08980; Tue, 8 Dec 1998 20:09:31 -0800 Received: from [209.122.117.150] by inanna.webcom.com (WebCom SMTP 1.2.1) with SMTP id 15727282; Tue Dec 08 13:07 PST 1998 Message-Id: <366D95AA.B1CD18BE@echidna.com> Date: Tue, 08 Dec 1998 16:10:02 -0500 From: Graeme Tait Reply-To: graeme@echidna.com Organization: Echidna X-Mailer: Mozilla 4.02 [en]C-DIAL (Win95; U) Mime-Version: 1.0 To: Dan Nelson Cc: FreeBSD-questions@FreeBSD.ORG Subject: Re: ftpd doesn't always die with broken connections References: <366C4FA4.C67199B0@echidna.com> <19981207161806.A77669@emsphone.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks - that did the trick. Actually one of the two residual ftp processes went away in about an hour after I enabled the keepalive, the other in about an hour and a half. Apparently, I got credit for time already on the clock (a mere 22 days!). If I want to ensure the keepalive remains in effect after a reboot, is it appropriate to add the sysctl command to rc.local or is some other way preferred? What is the downside to having keepalives on? I came across information that seemed very negative about using them, but if connections are only probed every four hours, what harm could be done? -- Graeme Tait - Echidna Dan Nelson wrote: > > In the last episode (Dec 07), Graeme Tait said: > > I have a couple of FreeBSD servers (2.2.6R and 2.2.7S) to/from which > > large files are often transferred by users with dial-up ISP access. > > Inevitably the connections fail occasionally in mid-transfer. > > > > Most of the time the ftpd daemon goes away gracefully in a few > > minutes. But sometimes it hangs around much longer, or indefinitely: > > > > From ps aux | grep ftpd (done today): > > > > 3940 0.0 0.1 292 184 ?? Is 16Nov98 0:01.82 ftpd: ip219.tu > > 10051 0.0 0.1 292 184 ?? Is 16Nov98 0:00.05 ftpd: ip-50-10 > > > > Running netstat shows connections ESTABLISHED on local ports 20 and > > 21 for the above two remote hosts. > > .. which means that the transfer to/from the other machine has stopped. > Judging by the partial hostnames, I'd guess that the other end was a > dialup connection that lost its connection during an upload. ftpd is > simply waiting in a read() call for data that will never come. The > process isn't dying because the idle timeout only applies at the ftp > prompt, not when transferring data. > > Try turning keepalives on. That should drop the connection four hours > after the client disappears. > > sysctl -w net.inet.tcp.always_keepalive=1 > > -Dan Nelson > dnelson@emsphone.com > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message