Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2020 11:10:15 +0200
From:      Per Hedeland <per@hedeland.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Shared object "libnetgraph.so.4" not found, required by "netstat"
Message-ID:  <0278cb1e-8084-6dce-5ac7-1e5297ff40d5@hedeland.org>
In-Reply-To: <20200514011537.GC23072@bastion.zyxst.net>
References:  <20200512154502.GH59811@bastion.zyxst.net> <20200513180158.GA23072@bastion.zyxst.net> <70cc3458-237f-847c-03f0-0767c26f6b89@fastmail.com> <8570e125-f34d-840a-5803-376d43bc9723@hedeland.org> <20200514011537.GC23072@bastion.zyxst.net>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 2020-05-14 03:15, tech-lists wrote:
> On Wed, May 13, 2020 at 10:00:23PM +0200, Per Hedeland wrote:
>>
>> Hm, netstat should be expected to require libnetgraph.so.4 - at least
>> on 12.1-RELEASE:
>>
>> $ ldd /usr/bin/netstat
>> /usr/bin/netstat:
>>        libkvm.so.7 => /lib/libkvm.so.7 (0x80026b000)
>>        libmemstat.so.3 => /usr/lib/libmemstat.so.3 (0x80027e000)
>>        libxo.so.0 => /lib/libxo.so.0 (0x800284000)
>>        libutil.so.9 => /lib/libutil.so.9 (0x8002a4000)
>>        libnetgraph.so.4 => /usr/lib/libnetgraph.so.4 (0x8002bb000)
>>        libc.so.7 => /lib/libc.so.7 (0x8002c2000)
>>        libelf.so.2 => /lib/libelf.so.2 (0x8006bb000)
>>
>> I.e. the problem is presumably not with netstat, but that
>> /usr/lib/libnetgraph.so.4 doesn't actually exist on the specific VM. I
>> don't know whether freebsd-update can be expected to re-create files
>> that have "gone missing" other than due to changes between FreeBSD
>> versions, but I wouldn't think so (AFAIK /usr/lib/libnetgraph.so.4 has
>> been part of the release since at least 10.3-RELEASE - probably much
>> longer, it's just the oldest version I have around).
>
> Here's my ldd output from the affected vm:
>
> root@REDACTED:~ # ldd /usr/bin/netstat
> /usr/bin/netstat:
>         libkvm.so.7 => /lib/libkvm.so.7 (0x80026b000)
>         libmemstat.so.3 => /usr/lib/libmemstat.so.3 (0x80027e000)
>         libxo.so.0 => /lib/libxo.so.0 (0x800284000)
>         libutil.so.9 => /lib/libutil.so.9 (0x8002a4000)
>         libnetgraph.so.4 => not found (0)

This is the expected output if /usr/lib/libnetgraph.so.4 doesn't
exist.

>         libc.so.7 => /lib/libc.so.7 (0x8002bb000)
>         libelf.so.2 => /lib/libelf.so.2 (0x8006b4000)
> root@REDACTED:~ #
>> Does it work to run netstat outside of cron?
>
> No.
>
> root@REDACTED:~ # netstat
> ld-elf.so.1: Shared object "libnetgraph.so.4" not found, required by "netstat"
> root@REDACTED:~ #
> Maybe the "fix" would be to copy libnetgraph.so.4 from another vm.

I think so - maybe do a 'ls -l /usr/lib/libnetgraph.so.4' first to
verify that it really is *missing*.

> But what's
> worrying for me is, how was this file "lost" in the first place? Hardly any
> console/ssh interaction is used on this particular vm. It hosts a https web service, sends email (it's not an email relay though), has very wrapped sshd access, and that's it.

May be hard/impossible to figure out at this point... I'd first of all
try to find out whether it was missing from day one, which would imply
an installation problem (e.g. full disk?) - or if not, try to find out
*when* it went missing, and check logs around that time (if still
available) for any hints. I.e. pretty obvious stuff, and definitely
not guaranteed to give any result.

--Per



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?0278cb1e-8084-6dce-5ac7-1e5297ff40d5>