Shared object "libnetgraph.so.4" not found, required by "netstat"

Per Hedeland per at hedeland.org
Wed May 13 20:00:55 UTC 2020


On 2020-05-13 20:31, Yuri Pankov wrote:
> tech-lists wrote:
>> On Tue, May 12, 2020 at 04:44:35PM +0100, tech-lists wrote:
>>> Hi,
>>>
>>> I'm getting this error in my daily reports:
>>>
>>> ld-elf.so.1: Shared object "libnetgraph.so.4" not found, required by "netstat"
>>>
>>> seems to hapen when daily cron runs network interface totals.
>>>
>>> This is a freebsd bhyve vm running on a freebsd host:
>>>
>>> vm: FreeBSD 12.1-RELEASE-p3 GENERIC  amd64
>>>
>>> # freebsd-version -kru
>>> 12.1-RELEASE-p3
>>> 12.1-RELEASE-p3
>>> 12.1-RELEASE-p4
>>>
>>> it's kept up-to-date with freebsd-update. The messages I get from
>>> freebsd-update are a little odd:
>>>
>>> # freebsd-update fetch
>>> src component not installed, skipped
>>> Looking up update.FreeBSD.org mirrors... 3 mirrors found.
>>> Fetching metadata signature for 12.1-RELEASE from update1.freebsd.org... done.
>>> Fetching metadata index... done.
>>> Inspecting system... done.
>>> Preparing to download files... done.
>>>
>>> No updates needed to update system to 12.1-RELEASE-p4.
>>> # freebsd-update install
>>> src component not installed, skipped
>>> No updates are available to install.
>>> Run '/usr/sbin/freebsd-update fetch' first.
>>>
>>> I thought netgraph etc would be taken care of by freebsd-update? How can I
>>> fix?
>>>
>>> thanks,
>>
>> I upgraded again today with freebsd-update and rebooted.
>>
>> % freebsd-version -kru
>> 12.1-RELEASE-p5
>> 12.1-RELEASE-p5
>> 12.1-RELEASE-p5
>>
>> same error:
>>
>> Network interface status:
>> ld-elf.so.1: Shared object "libnetgraph.so.4" not found, required by "netstat"
>>
>> What's odd is it's only this one bhyve vm with it. There are other bhyve vms
>> on the same host at the same revision without this issue. There's no
>> /etc/src.conf or /etc/make.conf. It's otherwise working fine.
>
> Is it possible that you modified netstat on this specific VM and freebsd-update refuses to update it?  Does the binary match with other VMs?

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).

Does it work to run netstat outside of cron?

--Per Hedeland


More information about the freebsd-questions mailing list