From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 6 23:23:30 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 9EDE216A4CE; Sun, 6 Feb 2005 23:23:30 +0000 (GMT) Received: from mail.ipnet.kiev.ua (cielago.ip.net.ua [82.193.96.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB85C43D49; Sun, 6 Feb 2005 23:23:28 +0000 (GMT) (envelope-from nick@nicks.ipnet.kiev.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by mail.ipnet.kiev.ua (8.12.11/8.12.11) with ESMTP id j16NMuF5019378; Mon, 7 Feb 2005 01:22:56 +0200 (EET) (envelope-from nick@nicks.ipnet.kiev.ua) Received: from mail.ipnet.kiev.ua ([82.193.96.7]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 38679-04; Mon, 7 Feb 2005 01:23:05 +0200 (EET) Received: from nicks.ipnet.kiev.ua (82.193.102.156.ipnet.kiev.ua [82.193.102.156]) by mail.ipnet.kiev.ua (8.12.11/8.12.11) with ESMTP id j16NMtXc019375 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Feb 2005 01:22:55 +0200 (EET) (envelope-from nick@nicks.ipnet.kiev.ua) Received: from nicks.ipnet.kiev.ua (localhost [127.0.0.1]) by nicks.ipnet.kiev.ua (8.13.1/8.13.1) with ESMTP id j16NN5fm002458; Mon, 7 Feb 2005 01:23:05 +0200 (EET) (envelope-from nick@nicks.ipnet.kiev.ua) Received: (from nick@localhost) by nicks.ipnet.kiev.ua (8.13.1/8.13.1/Submit) id j16NN5nx002457; Mon, 7 Feb 2005 01:23:05 +0200 (EET) (envelope-from nick) Date: Mon, 7 Feb 2005 01:23:05 +0200 From: Nick Strebkov To: Robert Watson Message-ID: <20050206232304.GA2346@nicks.ipnet.kiev.ua> Mail-Followup-To: Nick Strebkov , Robert Watson , Deomid Ryabkov , freebsd-hackers@freebsd.org, Milan Obuch References: <4200DCF6.1010002@rojer.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-u Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.3-STABLE X-Real-Name: =?koi8-u?B?89TSxcLLz9cgSMnLz8zByiDhzsHU?= =?koi8-u?B?z8zYxdfJ3g==?= X-Virus-Scanned: by amavisd-new at ip.net.ua cc: Deomid Ryabkov cc: Milan Obuch cc: freebsd-hackers@freebsd.org 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: Sun, 06 Feb 2005 23:23:30 -0000 Hi, > > No, won't do the trick either. I cannot afford setting up watchdogs for > > every file or even every directory. And I'm essentially "interested" in > > every one of them (for mirroring purposes). A more general approach is > > needed. 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) > > The TrustedBSD Audit code should be able to fill this need -- the goal of > the Audit code is to be able to track "security critical events" in a > configurable way, so file open/link/symlink/unlink operations are an > important subset of that. We hope to integrate the Audit code into 6.x in > the next few months, and then (in as much as is possible given kernel ABI > requirements) merge for 5.5. However, this is some time away still, so > presumably can't help in the short term. The result, though, is an event > stream file that's mechanically parseable, and the even stream can be > configured to indicate which types of events are important at a fairly > fine granularity. Sounds great. But i have similar tasks (not so huge amount of files) and i'd prefer to extend kqueue/kevent with EVFILT_INODE filter to have ability to monitor changes in file without opening it. -- Nick Strebkov Public key: http://humgat.org/~nick/pubkey.txt fpr: 552C 88D6 895B 6E64 F277 D367 8A70 8132 47F5 C1B6