From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 31 02:14:03 2003 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 3A6F216A4CE for ; Fri, 31 Oct 2003 02:14:03 -0800 (PST) Received: from razorbill.mail.pas.earthlink.net (razorbill.mail.pas.earthlink.net [207.217.121.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C8F243FBF for ; Fri, 31 Oct 2003 02:14:02 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfje9.dialup.mindspring.com ([165.247.205.201] helo=mindspring.com) by razorbill.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 1AFWHr-0004Kr-00; Fri, 31 Oct 2003 02:13:49 -0800 Message-ID: <3FA23574.4876BFFB@mindspring.com> Date: Fri, 31 Oct 2003 02:12:04 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Nielsen References: <3F9CF3F6.8307.ABC1250@localhost> <20031031034719.1CE445A3C88@mail.npubs.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a41b6c9186c2bfbdac91626ae58f657405387f7b89c61deb1d350badd9bab72f9c350badd9bab72f9c cc: freebsd-hackers@freebsd.org Subject: Re: non-root process and PID files 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: Fri, 31 Oct 2003 10:14:03 -0000 Nielsen wrote: > Christopher Vance wrote: > > May I suggest a different feature: the ability to mark an open file > > (not just its fd) 'remove on close', with permission checked at mark > > time rather than close time (this status forgotten if not permitted > > when set) and the unlink actually done at close time only if the file > > has exactly one link and one open file instance at that time. > > WinNT (2K etc...) has this capability. Not saying that this makes it a > good idea though. In all Windows supported FS's, there is no separation between the inode and the directory entry referencing the inode, so you'd expect them to be able to do this from an open file reference, since they can always get the directory entry back. In response to another post: saving the path at startup time is no good, since if someone moves the file (if it's open) or removes it preemptively (and it's closed), then there's a race window in which another instance of the program may start, and the program exiting removes the wrong file (or gets a permission denied error). All this hacking to solve the problem of harmless old files lying around in /var/run is fraught with peril... -- Terry