Subject: wu-ftpd (beta 11), old idle connections and ftpwho output

From: Gildas Perrot <[email-masked]>
Date: Tue, 10 Dec 1996 10:35:23 +0100

Hi,

I am using wu-ftpd-2.4.2-beta-11 on BSD/OS 2.1. I noticed that some ftp 
sessions are idle but are not closed so they disallow new connections. I 
believed that beta11 solved this bug. How to kill those connections 
automatically ? Is it possible to use the output of ftpwho ?

Here is the ftpwho output I got : 

Service class remote: 
 3405  ??  IW     0:03.17 pppA221.francenet.fr: geraudie: STOR harry2.jpg\r\n (
28676  ??  I      0:00.49 ppp20.infrescom.fr: rfriess: STOR perso.html\r\n (ftp
 1342  ??  S      0:00.53 ppp-206-156.neuilly.club-internet.fr: shno: IDLE (ftp
11928  ??  IW     0:00.67 ppp31.francenet.fr: danitra: LIST\r\n (ftpd)
12498  ??  IW     0:00.82 ppp13.francenet.fr: danitra: LIST\r\n (ftpd)
11569  ??  IW     0:00.72 ppp36.francenet.fr: danitra: LIST\r\n (ftpd)
   -   6 users ( 10 maximum)

Furthermore, there is no explanation in manual pages about the output of 
'ftpwho'.

Thanks in advance for your help.		Gildas.
-- 
Gildas PERROT, [email-masked]         __o
FranceNet, 28 rue Desaix, 75015 Paris ---_ \<,_
http://www.francenet.fr            ---- (_)/ (_)

---

From: Alain Magloire <[email-masked]>
Date: Thu, 12 Dec 1996 17:40:29 -0500 (EST)

> sessions are idle but are not closed so they disallow new connections. I 
...
> 11569  ??  IW     0:00.72 ppp36.francenet.fr: danitra: LIST\r\n (ftpd)

1-

IDLE does'nt mean necessarily dead(zombies)
it means "doing nothing"(shiftless)
it also apply to sys. admin ... i.e.  lazy ;-)

Seriously if a client connect to you ftpd server and don't do nothing
the process is IDLE, it will eventually time out and die _if_
the client doesn't issue command to change the state.

If you kill the IDLE's then you may be killing some legitimate
connections.

I beleive you can change the timeout on the command line, here
the defaults values
-------------ftpd.c---------------------
int timeout = 900;              /* timeout after 15 minutes of inactivity */
int maxtimeout = 7200;          /* don't allow idle time to be set beyond 2
                                 * hours */
-------------ftpd.c---------------------

2-

Now don't confuse IDLE processes with zombies(hang processes)
They were some previous posts on this matter(see the archive):
  - can't get a lock
  - connection from Web Browsers with the passive modes
  -.....

I beleive that `Michael Brennen' had a small patch that can be
of help if you're overwhelmed with zombies(not IDLES ;-)(see archive)

3-

> Furthermore, there is no explanation in manual pages about the output of 

yes, the ftp{who,count} man pages are ... to be gentle dry :)
If you do have spare time don't be shy to update them 8-)

4-

> automatically ? Is it possible to use the output of ftpwho ?

Well if you insist
sure why not ? you have to do a little `massage' on the ouput

or just has good
ps -auxwww | grep ftp | grep IDLE | awk '{print $2}'|xargs kill -9

Very rude and not recommanded.
/bin/ps options may vary on the OS.

4-
Good luck, and Joyeux Noe:l
--
alain

---

From: Michael Brennen <[email-masked]>
Date: Fri, 13 Dec 1996 09:40:29 -0600 (CST)

Not zombies -- that is a particular Unix process state.

The patch *may* help with 'hung' processes -- normal processes that are
waiting for data that will never come.

YMMV.

   -- Michael

> of help if you're overwhelmed with zombies(not IDLES ;-)(see archive)

--- ftpd.c.b11	Wed Jul 17 15:23:24 1996
+++ ftpd.c	Wed Aug  7 17:04:39 1996
@@ -2169,7 +2169,9 @@
         if (select(pdata+1, &set, (fd_set *) 0, (fd_set *) 0, &timeout) == 0 ||
             (s = accept(pdata, (struct sockaddr *) &from, &fromlen)) < 0) {
 #else      
+        alarm(120);
         s = accept(pdata, (struct sockaddr *) &from, &fromlen);
+        alarm(0);
         if (s < 0) {
 #endif
             reply(425, "Can't open data connection.");