[Pkg-mpd-maintainers] Bug#699208: some more

Benjamin Kaduk kaduk at MIT.EDU
Wed May 22 03:03:59 UTC 2013


On Wed, 22 May 2013, Guillem Jover wrote:

> The /proc/<PID>/exe and other native equivalent implementations on
> BSDs do not give anything meaningful when the inode has been removed,
> and as it stands s-s-d uses the Linux method on kFreeBSD. We noticed
> this last year (see #652575, CCed to debian-bsd), and I played with
> different methods, but there's currently no way to retrieve the exec
> path from a process whose executable has been removed (not even with
> sysctl KERN_PROC_PATHNAME, only Linux and HPUX seem to have sane
> interfaces for this). I'll recheck my notes to make sure though.

It seems like the position of upstream FreeBSD is that, once a file is 
opened, its name is basically lost or unreliable.  Going from a vnode 
in-kernel to a name is provided on a "best-effort" basis based on what's 
in the namecache, but is explicitly not a robust/supported interface and 
is allowed to fail.  Whether the file in question is being executed as a 
process binary is not relevant.

> Handling this was on my TODO for dpkg 1.17.x, and I guess I'll have
> to switch the --exec option on kFreeBSD to use the KVM method, which
> is unfortunately based on the process argv...

If I am reading #699208 and #652575 correctly, the --exec option is 
approximately the only option.

-Ben Kaduk



More information about the Pkg-mpd-maintainers mailing list