Subject: ftpd zombies

From: "Matthew Smith" <[email-masked]>
Date: Fri, 15 Aug 1997 15:35:55 -0400

Hello.
I am having a problem with ftpd processes being left running when a client
disconnects abnormally.  It doesn't happen every time (I haven't been able
to determine the exact circumstances which cause it), but I notice several
processes running every day which I am sure have no active connections.

Has anyone else seen this happen?  If so, is there a way to avoid it?

Thanks for any help.

Matt

------------------
Matthew Smith
Director of Engineering and Operations
Safeguard Interactive, Inc.
[email-masked]

---

From: Jon Lewis <[email-masked]>
Date: Sat, 16 Aug 1997 02:46:43 -0400 (EDT)

> Has anyone else seen this happen?  If so, is there a way to avoid it?

I used to see this frequently...especially hung wu.ftpd sessions that got
stuck during a file transfer.  I hacked the source adding a -z commandline
option (z for zap :).  The arg it takes is an integer number of seconds
used in alarm() calls strategicaly placed around all read and write calls
I thought might potentially block forever.  I've been running with -z240
for a few weeks and have found no more hanging ftpd's and gotten no
complaints of breakage.  I should probably clean up the patch, apply it to
beta14, and submit it back to the list. 

I really don't know how much all the alarm(var)/alarm(0) calls affect
performance, or if they do at all.  Maybe someone else can theorize on
that.  It doesn't appear to affect throughput at all.

------------------------------------------------------------------
 Jon Lewis <[email-masked]>  |  Unsolicited commercial e-mail will
 Network Administrator       |  be proof-read for $199/message.
 Florida Digital Turnpike    |  
______http://inorganic5.fdt.net/~jlewis/pgp for PGP public key____

---

From: Ben Mehlman <[email-masked]>
Date: Mon, 18 Aug 1997 12:42:11 -0400 (EDT)

> Has anyone else seen this happen?  If so, is there a way to avoid it?

Yes, it happens when the user is uploading, and suddenly dissapears (eg
modem connection drops etc).  The data connection is blocked on read, and
the control connection has nothing being written to it, so ftpd is unaware
that anything is wrong.  There's no timeout on the data connection
unfortunately.

The way I solved this in a hurry was to periodically run a perl script to
kill the ftpds that have been around too long.  I posted that (very short)
script to the list once, but I'll mail it to you if you want it...

-Ben
----------------------------------------------------------------------------
Ben Mehlman             The reasonable man adapts himself to the world; the 
Prodigy Services Corp   unreasonable one persists in trying to adapt the
[email-masked]   world to himself.  Therefore all progress depends on
                        the unreasonable man. -George Bernard Shaw