Subject: BeroFTPD handling of pid file contention

From: Roger Hanke <[email-masked]>
Date: Thu, 17 Dec 1998 12:20:54 -0500

Bernhard,
 First I apologize since I am pretty sure I 
remember reading about this a while back, but since
everyone is asking you for info on your version....

 How are you handling the situation when the fcntl
lock of the pid file fails? We do get flooded by
these messages at times when a lot of connect requests
come in a short period. We are not using the class
maximum limits currently so was curious if there 
is any way to avoid this lookup/recording step
completely?

	Thanx,
	Roger Hanke

-----------------------------------------------------
 Roger A. Hanke         AT&T Web Site Services
 (732)576-5738          [email-masked]
 FAX (732)576-6041      http://lynxhub.att.com/~rah/
-----------------------------------------------------

---

From: Bernhard Rosenkraenzer <[email-masked]>
Date: Thu, 17 Dec 1998 23:15:31 +0100 (CET)

On Thu, 17 Dec 1998, Roger Hanke wrote:

> come in a short period.

I haven't changed anything about this - so it's the same as in VR9.
I'll have a look at it and see if I can add the possibility to disable the
messages in 1.3.1.

LLaP
bero

-- 
Windows 98 supports real multitasking - it can boot and crash simultaneously.
***
Anyone sending unwanted advertising e-mail to this address will be charged
$25 for network traffic and computing time. By extracting my address from
this message or its header, you agree to these terms.

---

From: Gregory A Lundberg <[email-masked]>
Date: Thu, 17 Dec 1998 16:53:24 -0500 (EST)

On Thu, 17 Dec 1998, Roger Hanke wrote:

>  How are you handling the situation when the fcntl lock of the pid
> file fails? We do get flooded by these messages at times when a lot of
> connect requests come in a short period. We are not using the class
> maximum limits currently so was curious if there is any way to avoid
> this lookup/recording step completely?

Does the system operate normally, just you're getting slammed with all the
log messages?  If so, how about a compile-time patch to disable this
message to the system log?

-- 

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195

-- 

Index: config.h
===================================================================
RCS file: /cvsroot/wu-ftpd/config.h,v
retrieving revision 1.1.1.1.2.7.2.9
diff -c -r1.1.1.1.2.7.2.9 config.h
*** config.h	1998/11/20 17:12:19	1.1.1.1.2.7.2.9
--- config.h	1998/12/17 21:47:22
***************
*** 248,250 ****
--- 248,256 ----
   */
  #undef DISABLE_PORT
  #undef DISABLE_PASV
+ 
+ /*
+  * Define this to suppress messages about PID locks causing the daemon to
+  * sleep.  This should only be needed at busy sites.
+  */
+ #undef NO_PID_SLEEP_MSGS

Index: src/access.c
===================================================================
RCS file: /cvsroot/wu-ftpd/src/access.c,v
retrieving revision 1.1.1.1.2.7.2.8
diff -c -r1.1.1.1.2.7.2.8 access.c
*** src/access.c	1998/12/01 22:07:07	1.1.1.1.2.7.2.8
--- src/access.c	1998/12/17 21:50:11
***************
*** 1156,1168 ****
--- 1156,1172 ----
  
  #ifdef HAVE_FLOCK
      while (flock(pidfd, LOCK_EX)) {
+ #ifndef NO_PID_SLEEP_MSGS
          syslog(LOG_ERR, "sleeping: flock of pid file failed: %s",
+ #endif
  #else 
  	arg.l_type = F_WRLCK;
  	arg.l_whence = arg.l_start = arg.l_len = 0;
  	while ( -1 == fcntl( pidfd, F_SETLK, &arg) ) {
+ #ifndef NO_PID_SLEEP_MSGS
  		syslog(LOG_ERR, "sleeping: fcntl lock of pid file failed: %s",
  #endif
+ #endif
                 strerror(errno));
          sleep(1);
      }
***************
*** 1233,1245 ****
--- 1237,1253 ----
  
  #ifdef HAVE_FLOCK
      while (flock(pidfd, LOCK_EX)) {
+ #ifndef NO_PID_SLEEP_MSGS
          syslog(LOG_ERR, "sleeping: flock of pid file failed: %s",
+ #endif
  #else 
      arg.l_type = F_WRLCK;
      arg.l_whence = arg.l_start = arg.l_len = 0;
      while ( -1 == fcntl( pidfd, F_SETLK, &arg) ) {
+ #ifndef NO_PID_SLEEP_MSGS
          syslog(LOG_ERR, "sleeping: fcntl lock of pid file failed: %s",
  #endif
+ #endif
                 strerror(errno));
          sleep(1);
      }
***************
*** 1334,1345 ****
--- 1342,1357 ----
  
  #ifdef HAVE_FLOCK
      while (flock(pidfd, LOCK_EX)) {
+ #ifndef NO_PID_SLEEP_MSGS
          syslog(LOG_ERR, "sleeping: flock of pid file failed: %s",
+ #endif
  #else 
      arg.l_type = F_WRLCK;
      arg.l_whence = arg.l_start = arg.l_len = 0;
      while ( -1 == fcntl( pidfd, F_SETLK, &arg) ) {
+ #ifndef NO_PID_SLEEP_MSGS
          syslog(LOG_ERR, "sleeping: fcntl lock of pid file failed: %s",
+ #endif
  #endif
                 strerror(errno));
          sleep(1);