Bug#3065: lsof looks for /System.map
You (Dominik Kubla) wrote:
> >>>>> Ian Jackson writes:
>
> > Why does lsof need to read System.map at all ? Can't it get the
> > information it needs from /proc ?
>
> No: the contents of System.map and /proc/ksyms differ! The later has
> only the exported symbols needed for kernel modules, while the first
> has all kernel symbols!
Yeah but lsof only needs to know which files are open and what processes
have them opened. All this info is available through /proc/*/fd/*.
See for example "fuser"; it does something similar to lsof and uses
this approach.
> And this is not really a bug, since the kernel installation script
> takes care that the symlink (i never had a problem with lsof!)
>
> /System.map -> /boot/System.map-<VERSION>
Duh. I hate the /System.map and /vmlinuz symlinks in /. I feel they
clutter up / without any reason; I prefer to keep that kind of stuff
in /boot (and I do).
> is up to date. For those of you installing their own kernels or using
> more than one that is something trivial to fix at boot time: just add
> the following line to /etc/init.d/boot (Miquel could you do that
> please?):
>
> ln -s /boot/System.map-`uname -r` /System.map
Nah. As I said, I don't like the /System.map symlink. If you want to have
one, dump a script in /etc/rc.boot that takes care of it. (see the
manpages for rc.boot).
> > We should be trying to phase out programs that grobble through
> > kernel memory ...
>
> Which it does not, it does only read the kernel symbols from the named
> file. (For the reason: see above)
And then it reads kernel memory. That's why it needs the symbols..
and it is totally unnessecary.
> I will reassign this bug report to the sysvinit package, so that Miquel
> can close it when he releases the next sysvinit.
Please don't.
Mike.
--
Miquel van | Cistron Internet Services -- Alphen aan den Rijn.
Smoorenburg, | mailto:info@cistron.nl http://www.cistron.nl/
miquels@het.net | Tel: +31-172-419445 (Voice) 430979 (Fax) 442580 (Data)
Reply to: