Date: Fri, 31 Oct 2003 02:12:04 -0800 From: Terry Lambert <tlambert2@mindspring.com> To: Nielsen <nielsen@memberwebs.com> Cc: freebsd-hackers@freebsd.org Subject: Re: non-root process and PID files Message-ID: <3FA23574.4876BFFB@mindspring.com> References: <3F9CF3F6.8307.ABC1250@localhost> <20031031034719.1CE445A3C88@mail.npubs.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FA23574.4876BFFB>