Subject: Re: Hanging ftpd processes

From: Bob Woodward <[email-masked]>
Date: Mon, 03 Mar 1997 11:52:18 -0800

At 01:43 PM 2/28/97 -0500, you wrote:
>Howdy folks,
>I have two questions about the hanging processes. I am currently
>running the 2.4 version and have made modifications. Is there a fix
>for the hanging procs that I can incorporate into 2.4 without going
>to 2.4 B12? Second, earlier I had seen questions about writing a
>simple script to kill of hanging procs. Is that a viable solution?
>
>thanks for any help
>
>Doug

I'm using a script to kill off ftp jobs that are over 24 hours.  These are
sensed on my Solaris 2.4 system because that's when the time entry changes
to a date in the 'ps -ef' listing.  This means they end up hanging around
for anywhere from 24 to 36 hours since I run the script twice a day.

----------
Bob Woodward, Seattle FilmWorks     ([email-masked])
Data Processing Department	(206) 281-1390 ext. 475

Visit our Web Site to learn about getting your pictures via downloads on
the Internet!
Point your browser to "http://www.filmworks.com".

---

From: Alain Magloire <[email-masked]>
Date: Tue, 4 Mar 1997 17:52:25 -0500 (EST)

Bonjour Mr Bob Woodward
> for anywhere from 24 to 36 hours since I run the script twice a day.

This is something I'm trying to track down, but can't put my
finger on... Hagngin ftpds...

Having a cronjob that goes on a killing spree every now and then
is tempting but doesn't resolve the real of the problem.

At first I thougth it was the locking accouting mechanism(and endless loop
'til the process got the lock) but after modification of the code, things
didn't improve that much.

The problem did not go away with the beta versions.

If anyone can give me more input on this,

I appreciate

-- 
au revoir, alain

---

From: Michael Brennen <[email-masked]>
Date: Tue, 4 Mar 1997 17:56:07 -0600 (CST)

It appears to me to come from timeouts when uploading.  Those are the only
stuck daemons I see.  (linux 2.0.27).  It is especially prone to happen
when coming across the Internet at busy times.

   -- Michael

---

From: David Greenman <[email-masked]>
Date: Tue, 04 Mar 1997 16:33:59 -0800

>finger on... Hagngin ftpds...

   The main hang problem is probably occuring on uploads. I don't believe
that keepalives are enabled, so if the connectivity goes away with the remote
host at the 'right' time, the server kernel won't be expecting any more data
and the connection will just sit idle. If you enable keepalives, then the
connection should eventually time out, but this could take awhile (the
keepalive timeout period is 2 hours). A better solution is to set an alarm
prior to beginning the data transfer (either upload or download) - similar
to what is done in early in the main command loop for idle sessions.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project

---

From: "Ariel R. Orellana" <[email-masked]>
Date: Tue, 4 Mar 1997 17:38:14 -0600

Hi all,

First, I'll introduce myself.  I'm Ariel Orellana, I'm the network 
administrator.  24 years old.  I think that cavers the basics.  

Now, on to the question... just installed wu-ftpd 2.4 on a HP-UX 10.01 system.

I'm having trouble granting access to hosts that are not on my /etc/hosts file. 
We haven't configured DNS - yet (it's a private network).  Maybe a month or so. 
Meanwhile, how can I grant access to everyone without having to add any and all 
hosts to my file?

In case it's necessary, my ftpaccess file looks something like this:

class all anonymous,guest,real *
...
...

Ariel R. Orellana
Network Manager
Servicios Industriales Penoles S.A. de C.V.

---

From: Bob Luckin <[email-masked]>
Date: Wed, 5 Mar 97 20:00:33 CST

Michael Brennen said (re hanging daemons) :-
> when coming across the Internet at busy times.

I'd been wondering why I hadn't come across this on my server (Solaris 2.5,
wustl 2.4)...  This would explain it, since we get very few uploads (I put
most of the data we make available under the root area myself, using cp/rcp.)

Thanks to all for helping clear this up...

Cheers, Bob

---

From: Michael Hughes <[email-masked]>
Date: Wed, 5 Mar 1997 23:58:15 -0500 (EST)

What flags, if any, does your ftpd run with?

								-- michael

---

From: [email-masked]
Date: Thu, 6 Mar 1997 10:35:18 -0500 (EST)

Michael,
In running the 2.4 generic version I run wuftpd with -l -L. We do a
lot of uploads compared to downloads and I end up seeing about 2-3
new processes hanging each day. Right now a lot of uploads is only 50
or so per day, but we might only do 3-4 downloads.

Doug

-- 
Doug Courtney
[email-masked]
(908)949-3597

---

From: Alain Magloire <[email-masked]>
Date: Thu, 6 Mar 1997 18:26:46 -0500 (EST)

It seems one the reason for the servers hang is when
the clients do not issue the FIN.

UPLOAD
  The client/server setup the connection(PORT or PASV), 
  but something went havoc. The server waits for hours,
  days, month (the read() never returns).
  David GreenMan proposed the use of keepalive timer option.

LOCKING
  Endless loops in acl_countusers(), acl_join(), acl_remove().
  This is easily detected; syslog is clobber with:

...sleeping: fcntl lock of pid file failed: 

  I've put a limited number of iterations before harakiri
  The side effects is _PATH_PIDNAMES may be corrupted.
  (more input needed)

PASV(web browsers ??)
  Client does the PASV, RETR sequence and goes havoc.
  A timer with select()(provided by C. Dick ? not sure)
  Also Michael Brennen(?) had a patch a timer around accept().
  I think it is include in beta-1{2,3}. 

So probably setting the keepalive option when opening a socket
can be an insteresting workd around.

Other ideas ?

-- 
au revoir, alain

---

From: David Greenman <[email-masked]>
Date: Thu, 06 Mar 1997 15:48:32 -0800

>can be an insteresting workd around.

   How about instead of setting an alarm(0) (clearing the alarm) when exiting
the command loop to process a command, set a larger alarm time like 24 hours?
This alarm would limit the maximum amount of time that any one file transfer
can take, but would still allow the ftp session to last more than a day in
total.

-DG

David Greenman

---

From: Alain Magloire <[email-masked]>
Date: Thu, 6 Mar 1997 19:54:11 -0500 (EST)

Bonjour Mr David Greenman

> can take, but would still allow the ftp session to last more than a day in

yes I see what you mean, but wu-ftpd for example version 13
use the alarm(in dataconn()), without carring if it was set before.

This is ok, because like you pointed out the alarm(timeout)
is reset every time reentering the command loop.
But it would make it hard to implement a global timer, well,
at least the use of alarm() should be done with care.

I wasn't thinking of using SOL_KEEPALIVE on the controlling socket
but only when doing transferts. So doing a setsockopt() in dataconn()
and probably getdatasock() should be enough.

#include <disclaimer.h>  /* :-) */

Althought the use of KEEPALIVE is controversial. it seems justified in
this scenario. 

Now that said :-), I probably need to do more tests
and back this with some facts.

-- 
au revoir, alain
_______P_________O____________I______R___________E___
POIRE: Premature Optimization Is the Root of all Evil

---

From: Bob Luckin <[email-masked]>
Date: Fri, 7 Mar 97 11:10:08 CST

[Re ftpd hanging...]
> can take, but would still allow the ftp session to last more than a day in

I'd be _most_ unhappy about this, unless it is an option which can be set via
the ftpaccess file, and the duration could be specified or set to "no time
out" (set the duration to 0 ?).

I have had genuine transfers from my server which have taken longer than
24 hours to complete.  If a user waits a long time for a large file to
transfer, only for it to fail before completion due to a 24 hour timeout,
they aren't going to be best pleased...

Cheers, Bob
-- 
Bob Luckin                   EDA Systems Distribution and Billings team
Texas Instruments
P O Box 650311, MS 3937      MSG: VOLY              Email: [email-masked]
Dallas, TX 75265   U.S.A.    Tel: (972) 917 5081    Fax: (972) 917 7966