From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 2 15:29:41 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97AF616A4CE for ; Wed, 2 Feb 2005 15:29:41 +0000 (GMT) Received: from ams-iport-1.cisco.com (ams-iport-1.cisco.com [144.254.224.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id E499743D54 for ; Wed, 2 Feb 2005 15:29:40 +0000 (GMT) (envelope-from molter@tin.it) Received: from ams-core-1.cisco.com (144.254.224.150) by ams-iport-1.cisco.com with ESMTP; 02 Feb 2005 16:39:53 +0100 X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAA== Received: from amsterdam.cisco.com (amsterdam.cisco.com [144.254.224.160]) by ams-core-1.cisco.com (8.12.10/8.12.6) with ESMTP id j12FTbiN020865 for ; Wed, 2 Feb 2005 16:29:37 +0100 (MET) Received: from [144.254.53.64] (barbapapa.cisco.com [144.254.53.64]) by amsterdam.cisco.com (8.12.10/8.12.6) with ESMTP id j12FTa8M019780 for ; Wed, 2 Feb 2005 16:29:37 +0100 (MET) Message-ID: <4200F259.3050500@tin.it> Date: Wed, 02 Feb 2005 16:31:37 +0100 From: Marco Molteni User-Agent: Mozilla Thunderbird 1.0 (X11/20050101) X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: freebsd-hackers@freebsd.org References: <41FF6869.5060709@rojer.pp.ru> <41FF8B00.2010208@fer.hr> <41FFA801.8070307@rojer.pp.ru> <200502011746.52908.milan@dino.sk> <4200DCF6.1010002@rojer.pp.ru> In-Reply-To: <4200DCF6.1010002@rojer.pp.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Question: tracking filesystem changes? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2005 15:29:41 -0000 Deomid Ryabkov wrote: [..] > E.g., if an unlink call is issued and an inode is within a particular > filesystem (luckily, most of our data > already lives on or can be easily moved to a separate filesystem), a > notice is sent to some userland daemon: > "file /www/xxx/yyy.shtml is unlinked". Or opened for writing, or > renamed... etc. > The file is then scheduled for distribution to mirrors. > The idea seems simple and straightforward, yet I don't know if it is > achievable. > > The essential part is obtaining the full pathname of the file (won't > bother with hardlinks at first, they aren't used here). > Could that be done with the FreeBSD's filesystem (vnode/vfs?) code? > (which I'm not familiar with) yet another suggestion: ;-) what about a shared library shim? That is, you use LD_PRELOAD and intercept calls to the system calls you are interested in. This trick is also called interposing. say your executable calls open(). The shim intercepts open(), does its logging/triggering/whatever, calls the real syscall and returns. It is just a wrapper. This is user-level, but works also with executables for which you don't have source code, they just have to be dynamically linked against libc. marco