Subject: hanging daemons problem

From: [email-masked] (Nathalie Feng)
Date: Thu, 4 Apr 1996 09:44:16 -0500

Hi,

I am developing a project using the ftp daemon version wu-ftpd-2.4.
However, I am facing a problem which I haven't been able to solve.
 
The problem is that, sometimes when the ftp clients fail to close the
connections gracefully (e.g.  clients exit SUDDENLY), it will cause 
the ftp daemons to hang indefinitely on my system.  It looks like the
daemon's timer does not work under this circumstance.

I would very much appreciate if anyone can give me some hints on
this, or perhaps some workarounds...

Thanks very much!

--nathalie

---

From: Sylvain Morin <[email-masked]>
Date: Thu, 4 Apr 1996 10:57:49 -0500

>this, or perhaps some workarounds...
I had a similar problem and this patch help me

Sylvain Morin

______________________________________________________________

This section is from the document '/Distribution list
log/WU-ftpd/log.started.940924'.

>From [email-masked] Tue Feb 14 14:11:17 1995
Date: Tue, 14 Feb 1995 20:11:17 -0600 (CST)
From: Vidiot <[email-masked]>
Subject: Re: defunct process slots
To: [email-masked]

<        I seem to be having a problem with poeple attaching to my
<FTP site and my system creates <defunct> users using the FTPD software.
<This machine is an OSF/1 v3.0 on an Alpha 2100 server. These <defunct>
<users take up process slots and eventually hang the system. Doing an
<FTPWHO shows no users in fact when I log in locally I am user -1.
<I use the same example for a banner page that is in the "Managing
<Internet Information Services" book by Oreilly...

Yep, I've seen and I've fixed (using a patch provided by one of the reader's
of this mailist).  I've attached it below.  You might have to modify the
header part, since it has been set up for SunOS.

MB
--
System Administrator - Extrel FTMS - Madison WI.
e-mail: [email-masked]
phone: (608) 273-8262  fax: (608) 273-8719  voice-mail: (800) 426-6488 ext 6293
Visit - http://www.ftms.com/vidiot/  (Your link to the world of Star Trek)

*** ftpd.c.orig	Wed Apr 13 16:17:18 1994
--- ftpd.c	Fri Nov 25 14:22:10 1994
***************
*** 77,83 ****
  #else
  #include <syslog.h>
  #endif
! #include <time.h>
  #include "conversions.h"
  #include "extensions.h"
  #include "pathnames.h"
--- 77,83 ----
  #else
  #include <syslog.h>
  #endif
! #include <sys/time.h>
  #include "conversions.h"
  #include "extensions.h"
  #include "pathnames.h"
***************
*** 1707,1714 ****
--- 1707,1728 ----
          int s,
            fromlen = sizeof(from);

+ #ifdef FD_ZERO
+ 	struct timeval timeout;
+ 	fd_set set;
+
+ 	FD_ZERO(&set);
+ 	FD_SET(pdata, &set);
+
+ 	timeout.tv_usec = 0;
+ 	timeout.tv_sec = 120;
+
+ 	if (select(pdata+1, &set, (fd_set *) 0, (fd_set *) 0, &timeout) == 0 ||
+ 	    (s = accept(pdata, (struct sockaddr *) &from, &fromlen)) < 0) {
+ #else
          s = accept(pdata, (struct sockaddr *) &from, &fromlen);
          if (s < 0) {
+ #endif
              reply(425, "Can't open data connection.");
              (void) close(pdata);
              pdata = -1;

.

---

From: [email-masked] (Nathalie Feng)
Date: Fri, 5 Apr 1996 09:21:59 -0500

Hi,

Sylvain, thank you very much for your quick response and help.

I've added in the patch but it seems like the problem still exists for
me under certain conditions.  The problem is, the client isn't doing 
"manual" ftp, instead, all commands are sent internally, and many times
when client process exits abruptly AT ANY POINT, the daemon fails to 
detect the broken connection.

Also, this patch goes into the dataconn() function, that means if
the broken connection happens even before this function is called, the
broken connection will also go undetected...

Does anyone have this problem, and know how to solve it?  Also, is
this hanging ftp daemons a known and common problem...?

Thanks very much.

--nathalie