Subject: Ftpds that don't die...

From: Jonathan Roy <[email-masked]>
Date: Sun, 8 Dec 1996 10:17:25 -0500 (EST)

I have a number of ftpds that aren't dying. The oldest on Dec 8 is:

4706  0.0  0.8 2236  980 ?        S   Nov 13  0:00 in.ftpd -a

There are about 10 of them spread over the last month. This is with version
2.4.2-beta-11. Is there a known bug in beta11 that leaves an
occasional stray ftpd every few days, and a patch? Or a beta12?

Thanks!

-Jonathan

--
Jonathan Roy - [email-masked] -- Idle Communications, Inc.
Mail [email-masked] to advertise with the Games Domain! 
http://www.gamesdomain.com/ or http://www.gamesdomain.co.uk/

---

From: Michael Brennen <[email-masked]>
Date: Sun, 8 Dec 1996 14:25:30 -0600 (CST)

I've a tiny patch below that has eliminated most of the hung ftpds for me. 
I'm still getting a few if an upload is cancelled, but I haven't chased
those down; they haven't become that much of a nuisance yet.

   -- Michael

> occasional stray ftpd every few days, and a patch? Or a beta12?

--- 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.");

---

From: Michael Brennen <[email-masked]>
Date: Mon, 9 Dec 1996 12:34:02 -0600 (CST)

This is not original with me; in desperation I adapted it from some older
patches. As written, it very significantly reduces the number of hung
ftpds.

I suppose the 120 seconds might be short, but if I haven't gotten
*something* in two minutes I figure it is probably worth canning.  What
would you suggest for a value? 

   -- Michael

On Mon, 9 Dec 1996, Alain Magloire wrote:

> It's a nice little jig you have here ;-)
> Have any trouble with it ?
> Don't you think that the delay(120) is too short ?

---

From: Alain Magloire <[email-masked]>
Date: Mon, 9 Dec 1996 12:58:26 -0500 (EST)

> those down; they haven't become that much of a nuisance yet.

One other reason I've seen is that the process
can't get a lock on the _PATH_PIDNAMES.
This will show in the logs with:
"sleeping: fcntl lock of pid file failed"
or something similar.
I usually kill the culprit, or if too many
shutdown ftp cleanly.

--
bonne journe'e, alain