From dflists@iinet.net.au Mon Apr 12 23:44:54 2004 Received: with ECARTIS (v1.0.0; list fam); Mon, 12 Apr 2004 23:45:07 -0700 (PDT) Received: from mail.iinet.net.au (mail-15.iinet.net.au [203.59.3.47]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i3D6irKO003913 for ; Mon, 12 Apr 2004 23:44:54 -0700 Received: (qmail 24954 invoked from network); 13 Apr 2004 06:44:47 -0000 Received: from unknown (HELO monkey.localdomain) (203.59.88.76) by mail.iinet.net.au with SMTP; 13 Apr 2004 06:44:47 -0000 From: Derek Fountain To: fam@oss.sgi.com Subject: Can't quite see how it all fits together... Date: Tue, 13 Apr 2004 14:45:37 +0800 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404131445.37416.dflists@iinet.net.au> X-archive-position: 229 X-ecartis-version: Ecartis v1.0.0 Sender: fam-bounce@oss.sgi.com Errors-to: fam-bounce@oss.sgi.com X-original-sender: dflists@iinet.net.au Precedence: bulk X-list: fam I've spent the morning looking at FAM, trying to work out how it all fits together on my Linux system. I can't quite work it out, so maybe someone can help. I know what the project does, it's *how* it does it that puzzles me. The question that troubles me is basically "how does the daemon know a file has changed?" There appear to be three options: polling, imon and dnotify. Looking at the source code suggests that Imon is the favoured way, and this requires a /dev/imon device. I've not yet found a Linux kernel with one, or the imon module which appears to be required to support it. (I've checked SUSE, Mandrake and Redhat.) The FAQ says: qw/ Which kernel monitor should I use? On IRIX, use IMon. On Linux, use DNotify if it is supported by your kernel (it's standard on Linux 2.4 and higher). Otherwise, use IMon. / Um, OK. But I'm not sure I understand the question, let alone the answer. "Which kernel monitor should *I* use?" What does that mean? Do I somehow have to employ/start a kernel monitor which FAM can connect to? Or should the question be "Which is the prefered kernel monitor for FAM to use?" I have a recent kernel so I investigated DNotify. There's a document in the kernel tree describing the use of the kernel's DNotify feature but I can't find any code in the FAM source which matches the example given (trickery with a fcntl() syscall). Confusingly, Google led me to another piece of code called DNotify (http:// www.student.lu.se/~nbi98oli/dnotify.html) which I thought for a long time must be the kernel monitor the FAQ tells me I should be using. I now think this is a red herring, but am not entirely sure. Um, so where does that leave me? My kernel doesn't have imon, and the FAM source doesn't appear to use the kernel's DNotify feature, so perhaps it's just polling the filesystem? Which at least fits what I'm seeing, but seems to negate a lot of the advantages FAM suggests it has over a "poll it yourself" kind of approach. Can someone explain to me how it all fits together? From dflists@iinet.net.au Tue Apr 13 23:59:49 2004 Received: with ECARTIS (v1.0.0; list fam); Wed, 14 Apr 2004 00:00:06 -0700 (PDT) Received: from mail.iinet.net.au (mail-09.iinet.net.au [203.59.3.41]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i3E6xlKO007149 for ; Tue, 13 Apr 2004 23:59:48 -0700 Received: (qmail 14905 invoked from network); 14 Apr 2004 06:59:41 -0000 Received: from unknown (HELO monkey.localdomain) (203.59.88.76) by mail.iinet.net.au with SMTP; 14 Apr 2004 06:59:40 -0000 From: Derek Fountain To: fam@oss.sgi.com Subject: Notify or poll on Linux Date: Wed, 14 Apr 2004 15:00:41 +0800 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404141500.41274.dflists@iinet.net.au> X-archive-position: 230 X-ecartis-version: Ecartis v1.0.0 Sender: fam-bounce@oss.sgi.com Errors-to: fam-bounce@oss.sgi.com X-original-sender: dflists@iinet.net.au Precedence: bulk X-list: fam I've been playing with FAM 2.6.10 on my SUSE9.0 Linux machine. SUSE seem to have applied the dnotify patch to their package, and it works fine. Only, responses are a bit slow - I get change notification after 1 to 4 seconds after I actually change the monitored file. Is that normal? Or does it imply the dnotify isn't working and I'm waiting for FAM to poll or something? On a separate note, I was exploring FAM on the understanding that it could asyncronously tell me when a file had changed. I've done this using pure dnotify where a signal is generated when the file (i.e. directory) changes. From what I've read, FAM doesn't do that. I have to block, waiting for a event, or I have to poll occasionally. Do I understand that right? If so, if I'm writing an application which is constantly busy (i.e. not able to block), and which gets into tight loops where polling isn't easy, is there a simple way of getting an asyncronous signal from FAM? From ENVITE@telefonica.net Mon Apr 26 19:44:36 2004 Received: with ECARTIS (v1.0.0; list fam); Mon, 26 Apr 2004 19:44:41 -0700 (PDT) Received: from tnetsmtp2.mail.isp (smtp.telefonica.net [213.4.129.135]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i3R2iZKO025662 for ; Mon, 26 Apr 2004 19:44:36 -0700 Received: from telefonica.net ([80.36.179.168]) by tnetsmtp2.mail.isp (terra.es) with ESMTP id HWT2F900.DHS for ; Tue, 27 Apr 2004 03:21:09 +0200 Message-ID: <408DB57C.9040701@telefonica.net> Date: Tue, 27 Apr 2004 02:21:00 +0100 From: Noel Torres User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 X-Accept-Language: es-es, es, en MIME-Version: 1.0 To: fam@oss.sgi.com Subject: Excessive connections to my fam server Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 231 X-ecartis-version: Ecartis v1.0.0 Sender: fam-bounce@oss.sgi.com Errors-to: fam-bounce@oss.sgi.com X-original-sender: envite@telefonica.net Precedence: bulk X-list: fam Last time I did user@host$ netstat --ip I noticed a lot of (more than 100) incoming STABLISHED connections to my 1025 tcp port, and it wasn't listed in /etc/services. I become alert. Searching in IANA I found only "blackjack" as related to that port, and I had no service in my machine related to that. I become paranoid. Using user@host$ lsof -i TCP:1025 I detected the program that was really using that port, so I started searching the web about fam and I found you. So I want to ask you a few questions. - Is normal to have so much connections to my famd server? (I've no NFS server at all) - Is impossible to make fam obey -L when launched from inetd? - Can you register the fam port in IANA? You gave me a good scare. Thanks Noel Torres