Re: non-root process and PID files

From: Terry Lambert (tlambert2_at_mindspring.com)
Date: 10/31/03

  • Next message: Peter Pentchev: "Re: RFC: proposed new builtin for /bin/sh (associative arrays)"
    Date: Fri, 31 Oct 2003 02:12:04 -0800
    To: Nielsen <nielsen@memberwebs.com>
    
    

    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
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Peter Pentchev: "Re: RFC: proposed new builtin for /bin/sh (associative arrays)"

    Relevant Pages

    • Re: Directory Access Monitoring
      ... Claudius Zingerli wrote: ... I'm searching for something like: ... open file. ... Changes to the directory will change the inode and be reported ...
      (comp.unix.programmer)
    • Re: /var out of disk space, but not really
      ... If I look at disk usage using df, ... It could be that you have deleted the directory entry for an open file. ... Enterprise Technology Solutions, TD Bank Financial Group ...
      (comp.unix.admin)
    • Re: /var out of disk space, but not really
      ... If I look at disk usage using df, ... Clearly there is a discrepancy here and I can't find anything to delete ... It could be that you have deleted the directory entry for an open file. ...
      (comp.unix.admin)
    • Re: Logrotate is a pain
      ... /etc/logrotate.d/apache-conf which controls the logrotate of ... even if it is renamed or removed, the inode stays the same. ... if one program could suddenly remove an open file you would get a ... If you read any of the logrotate scripts in /etc/logrotate.d you will see ...
      (comp.os.linux.misc)
    • [PATCH 07/15] sysfs: kill unnecessary sysfs_get() in open paths
      ... There's no reason to get an extra reference to sysfs_dirent for an ... Open file has a reference to the dentry which in turn has ... static int sysfs_release(struct inode * inode, ...
      (Linux-Kernel)