Subject: fcntl

From: "Pomerance, Debbie" <[email-masked]>
Date: Mon, 23 Nov 1998 14:43:07 -0500

I have searched the list archives but have not found a satisfactory
answer for the occurrence of the following message,  can someone
enlighten me as to the cause and the relative severity of it vis-a-vis
user's access to wu services..

I'm using Wu ftp beta 18 on Solaris 2.5.1.  Thanks in advance.

ftpd[18356]: sleeping: fcntl lock of pid file failed: Resource
temporarily unavailable

Debbie Pomerance

-------------------------------------------------------------
Deborah Pomerance         (202) 226-6255
mailto:[email-masked]
Unix System Administration
U.S. House of Representatives  /  House Information Resources

---

From: Gregory A Lundberg <[email-masked]>
Date: Mon, 23 Nov 1998 16:27:21 -0500 (EST)

> ftpd[18356]: sleeping: fcntl lock of pid file failed: Resource

The WU-FTPD daemon uses a set of files, the pid files, to implement the
'limit' ftpaccess directive.  These files usually appear in /var/run or a
similar directory.  There is one file named 'ftp.pids-all' which holds the
connection information for all currently-running daemons.  In addition
there is one file for each 'class' defined in ftpaccess.  For example, on
my system I have a class 'local' so a file named 'ftp.pids-local' exists.

Whenever a new connection apepars, the daemon attempts to obtain an
exclusive lock on these pid files.  If available, the daemon uses the
fcntl(2) function; otherwise it uses the flock(2) function.

The message you're seeing appears when, in access.c, the daemon is not
able to get the exclusive lock.  The message "Resource temprorarily
unavailable" simply means the file is locked.  This is a _very_
short-lived error so the daemon waits one second (using the sleep(3)
function) and tries again.

If you're seeing this occassionally, it means your site is a very busy
one.  Don't worry about the message.

If you're seeing it a lot, you should look for possible problems on the
system.  For instance, if the /var/run directory is not local the locks
must process through NFS and, besides being unreliable, will take longer
to set and clear.  You should never mount this area; it should always be
on a local file system.

Other possible problems to look for are: excessive swapping due to too
many processes on the system (nice(1) some of the processes or move the
FTP server to a dedicated machine).  Excessive swapping due to
insufficient memory (buy more).  Slow or failing disk drives (replace
them).  Anything else which would slow down the machine in some way.

-- 

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