From nobody Mon Jan 01 20:30:28 2024 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T3ngL0Yd2z55VH9 for ; Mon, 1 Jan 2024 20:30:54 +0000 (UTC) (envelope-from dan@langille.org) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4T3ngK34bbz3gF0; Mon, 1 Jan 2024 20:30:52 +0000 (UTC) (envelope-from dan@langille.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=langille.org header.s=fm2 header.b=fVLUK1U2; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="s V27FvD"; spf=pass (mx1.freebsd.org: domain of dan@langille.org designates 64.147.123.25 as permitted sender) smtp.mailfrom=dan@langille.org; dmarc=pass (policy=none) header.from=langille.org Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 6DFAD3200AE3; Mon, 1 Jan 2024 15:30:50 -0500 (EST) Received: from imap42 ([10.202.2.92]) by compute7.internal (MEProxy); Mon, 01 Jan 2024 15:30:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=langille.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1704141049; x=1704227449; bh=bkT2kUUNtczQTOL0e7+WEL7eNAHHXrjTpEzhjcCzGMw=; b= fVLUK1U2/hnOfuU76f78NJERsuzLABaYfk25eR7LIEb919Mlt50VsEFk9fe67d46 lrNe/fiq7MYvS+vRHUtzWOSplAw2awD/54R3VEqrqv5WXhDDl3S0UrhJmmg8/Zqy 75tCCZhxyrhfioxKc4CJdYHI1QcUPuLpBctJG5lD7saQZH5l4I/tBPMpwtkgjRCY VdTFEDb3G8BVIAj5/Lxk6XSMbJsc3RJjfeeu7H4c3qqAyywdKb0kWvDx3yZVFcgL 8b1OcrkMrIjCex49TeynDtBsWbLF+aECO+YOpjYhsX1p/7i0ylKRpr3Q4a1vxJSO yZMEwnWk6Cs0RyONy5KnNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704141049; x= 1704227449; bh=bkT2kUUNtczQTOL0e7+WEL7eNAHHXrjTpEzhjcCzGMw=; b=s V27FvDkXZUhPl76cVHkT7tvrscNySJh4uzFzksdvG657qODfDJuW1AOCe0mUBDji JOkmDdbWUO0mO7UvrGJOQkdfnJIqMyg4/psIXzcuyfHm4wwOGOybYY5NBlB9J4s9 hDYc8MpmYdTYW9D5IHTB6uQWVwa13vM95BRwXOdDAUiZQ+SlwhLE6LBJQHSPiXt8 YtHVGukTXnL+h6qC6pWS4rlrM5X1K2UwAIghZ6LEEh0y1QbV7/2WEWlOKlFd+D+H zxkSoxw9iqupMowCj/UoyoWoxPVrf6j/RfjMCXcdLgpt80kqsuPVPN9UGZUni5fl FtwRGLVOWdp6mMeIq7C3w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegtddgudefkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvfevufgtgf esthhqredtreerjeenucfhrhhomhepfdffrghnucfnrghnghhilhhlvgdfuceouggrnhes lhgrnhhgihhllhgvrdhorhhgqeenucggtffrrghtthgvrhhnpeehkeeijeehveffkefggf dvhfekgeelteffjeehveevtddvledthfduledtffelieenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurghnsehlrghnghhilhhlvgdrohhrgh X-ME-Proxy: Feedback-ID: ifbf9424e:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8CA73BC0083; Mon, 1 Jan 2024 15:30:49 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1364-ga51d5fd3b7-fm-20231219.001-ga51d5fd3 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 Message-Id: In-Reply-To: References: Date: Mon, 01 Jan 2024 15:30:28 -0500 From: "Dan Langille" To: "Athanasios Douitsis" Cc: freebsd-ports Subject: Re: net-mgmt/net-snmp needs JAIL : off to get Memory usage Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.29 / 15.00]; FORGED_RECIPIENTS(2.00)[m:aduitsis@gmail.com,s:zi@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[langille.org,none]; R_DKIM_ALLOW(-0.20)[langille.org:s=fm2,messagingengine.com:s=fm2]; RWL_MAILSPIKE_VERYGOOD(-0.20)[64.147.123.25:from]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.25]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.25:from]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org]; DKIM_TRACE(0.00)[langille.org:+,messagingengine.com:+]; FROM_HAS_DN(0.00)[]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; FREEFALL_USER(0.00)[dan]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US] X-Rspamd-Queue-Id: 4T3ngK34bbz3gF0 X-Spamd-Bar: --- On Mon, Jan 1, 2024, at 3:15 PM, Athanasios Douitsis wrote: > Hey hello and happy new year Dan! Happy New Year to you too. > I think I must=E2=80=99ve requested an adjustment like a decade ago wh= en I was=20 > trying to use net-snmp from inside a jail. A part of the host MIB=20 > module was using some syscall (don=E2=80=99t fully recall which - prob= ably=20 > something with the memory) which wasn=E2=80=99t allowed from inside a = jail. Today, without the JAIL option enabled, in a jail we get: kvm_openfiles: /dev/mem: No such file or directory I'm happy the JAIL option exists. I'm also thinking we could also disable diskio as well, when in the jails. That should be in the host. This patch, while not ideal, is what I'm using at home for now. I've BCC'd the maintainer on this reply. > Kind regards, > -- > Athanasios Douitsis=20 > > >> On 1 Jan 2024, at 16:18, Dan Langille wrote: >>=20 >> =EF=BB=BFOn Thu, Dec 28, 2023, at 1:24 PM, Dan Langille wrote: >>>> On Thu, Dec 28, 2023, at 11:28 AM, Dan Langille wrote: >>>> Hello, >>>>=20 >>>> I've just solved a long-puzzling issue with net-mgmt/net-snmp which= was >>>> not reporting Memory Usage on my hosts. >>>>=20 >>>> Tests show it is related to the JAIL build-time configuration optio= n. >>>>=20 >>>> JAIL=3Doff: Options for running snmpd within a jail(8) >>>>=20 >>>> If off, the default, Memory Usage is available via snmpd. >>>>=20 >>>> If on, it is not. >>>>=20 >>>> One might ask: why have it on if not running in a jail? >>>>=20 >>>> Simplicity: I build my own packages. I could have one repo specific= ally >>>> for hosts (i.e. non-jails), but until now, it's never been an issue. >>>>=20 >>>> However, I want to point that that JAIL=3Doff does not seem to affe= ct >>>> usage within a jail. >>>>=20 >>>> It becomes clear what JAIL does when looking at the Makefile: >>>>=20 >>>> if ${PORT_OPTIONS:MJAIL} >>>> NET_SNMP_WITHOUT_MIB_MODULE_LIST+=3D host >>>> NET_SNMP_WITHOUT_MIB_MODULE_LIST+=3D ucd-snmp/memory >>>> CONFIGURE_ARGS+=3D --without-kmem-usage >>>> endif >>>>=20 >>>> Not it's clear. Don't report host-like objects when within a jail. >>>>=20 >>>> It is time for some flavors on this port? I know I'd like one for = my >>>> use: one without the above and with. >>>>=20 >>>> I'll see if I can mangle something up which works. >>>=20 >>> This works for me. >>>=20 >>> -- >>> Dan Langille >>> dan@langille.org >>> Attachments: >>> * patch-net-snmp-jail-flavor >>=20 >>=20 >> I forgot the mailing list strips attachments. Here is that patch, pa= sted in: >>=20 >> [9:16 air01 dan ~/Downloads] % cat patch-net-snmp-jail-flavor >> diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile >> index e5f60faefcbd..686c393991ea 100644 >> --- a/net-mgmt/net-snmp/Makefile >> +++ b/net-mgmt/net-snmp/Makefile >> @@ -18,6 +18,17 @@ LICENSE_FILE=3D ${WRKSRC}/COPYING >> NOT_FOR_ARCHS=3D mips mips64 >> NOT_FOR_ARCHS_REASON=3D SSP is currently broken on MIPS >>=20 >> +FLAVORS=3D default jail >> +FLAVORS?=3D ${FLAVORS:[1]} >> + >> +.if ${FLAVOR:U} =3D=3D jail >> +NET_SNMP_WITHOUT_MIB_MODULE_LIST+=3D host >> +NET_SNMP_WITHOUT_MIB_MODULE_LIST+=3D ucd-snmp/memory >> +CONFIGURE_ARGS+=3D --without-kmem-usage >> +.endif >> + >> +jail_PKGNAMESUFFIX=3D -jail >> + >> OPTIONS_DEFINE=3D IPV6 MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMM= Y TKMIB \ >> MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \ >> TLS NEWSYSLOG NOLIBPKG SCTP >> [9:17 air01 dan ~/Downloads] % >>=20 >> -- >> Dan Langille >> dan@langille.org >> --=20 Dan Langille dan@langille.org