From owner-freebsd-questions@freebsd.org Thu May 14 09:10:21 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 158812EA29B for ; Thu, 14 May 2020 09:10:21 +0000 (UTC) (envelope-from per@hedeland.org) Received: from mailout.easydns.com (mailout.easydns.com [64.68.202.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49N5NX2222z456V for ; Thu, 14 May 2020 09:10:19 +0000 (UTC) (envelope-from per@hedeland.org) Received: from localhost (localhost [127.0.0.1]) by mailout.easydns.com (Postfix) with ESMTP id 085E5C1120 for ; Thu, 14 May 2020 09:10:19 +0000 (UTC) Received: from mailout.easydns.com ([127.0.0.1]) by localhost (emo12-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5qcTGLUWtC1w for ; Thu, 14 May 2020 09:10:19 +0000 (UTC) Received: from hedeland.org (81-228-157-209-no289.tbcn.telia.com [81.228.157.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easydns.com (Postfix) with ESMTPSA id BF7D7C1082 for ; Thu, 14 May 2020 09:10:18 +0000 (UTC) Received: from pluto.hedeland.org (pluto.hedeland.org [10.1.1.5]) by tellus.hedeland.org (8.15.2/8.15.2) with ESMTPS id 04E9AFg3069207 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Thu, 14 May 2020 11:10:16 +0200 (CEST) (envelope-from per@hedeland.org) Subject: Re: Shared object "libnetgraph.so.4" not found, required by "netstat" To: freebsd-questions@freebsd.org 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> From: Per Hedeland Message-ID: <0278cb1e-8084-6dce-5ac7-1e5297ff40d5@hedeland.org> Date: Thu, 14 May 2020 11:10:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200514011537.GC23072@bastion.zyxst.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49N5NX2222z456V X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of per@hedeland.org has no SPF policy when checking 64.68.202.10) smtp.mailfrom=per@hedeland.org X-Spamd-Result: default: False [0.18 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[209.157.228.81.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.20)[-0.196,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[hedeland.org]; NEURAL_HAM_MEDIUM(-0.62)[-0.619,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[10.202.68.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16686, ipnet:64.68.200.0/22, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.19)[ip: (0.21), ipnet: 64.68.200.0/22(-0.39), asn: 16686(1.22), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 09:10:21 -0000 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