From nobody Wed Dec 14 07:28:06 2022 X-Original-To: freebsd-jail@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 4NX6R9702pz4jdPL for ; Wed, 14 Dec 2022 07:28:21 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (bastille.leidinger.net [89.238.82.207]) (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-signature ECDSA (P-256) client-digest SHA256) (Client CN "mailgate.leidinger.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NX6R93YVsz3nwy for ; Wed, 14 Dec 2022 07:28:21 +0000 (UTC) (envelope-from Alexander@leidinger.net) Authentication-Results: mx1.freebsd.org; none Received: from outgoing.leidinger.net (p5b165da3.dip0.t-ipconnect.de [91.22.93.163]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256 client-signature ECDSA (P-256) client-digest SHA256) (Client CN "outgoing.leidinger.net", Issuer "R3" (verified OK)) by mailgate.Leidinger.net (Postfix) with ESMTPSA id 3E2FC2212E for ; Wed, 14 Dec 2022 08:28:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leidinger.net; s=outgoing-alex; t=1671002889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=IDGZEKeIx/qcOjmadZM8QFRDK+ctArpQCEz+A833ddg=; b=KM7BBiz6O+g54uvwp0tB1nBFhpB7ghRgNB5BkrXWKBYqVvUQTLUd4NmnjlPZNfeDW5KZB2 Hu4JLNbxM9WvTPca46Qz/k5guRx5JOfdAgDNX1GIgl8jCVejFTnkWGB9v3DI9ONwOdK7OB +Ca+77j+hCMpFiEaPO+tIt/anI9oJ71NVQZShcWJv0sJs24/MldaB1j2+dq7mkFC/RZBsQ FFdr4XTpTIzIF2AEYMVN5xTvLsNF0f8CYotySN1jCmh0V2wjNvHg8DOQ1RlzJRrcXOUAdd vi7cgqUk21MbZPV6vOFc+1hOjyuyhFJ0u/AIj0kxpXQDyfBLUZzkLfy+ycY8VA== Received: from webmail.leidinger.net (localhost [127.0.0.1]) by outgoing.leidinger.net (Postfix) with ESMTP id C090B70F0 for ; Wed, 14 Dec 2022 08:28:06 +0100 (CET) Received: from www (uid 80) (envelope-from Alexander@leidinger.net) id 7b3cb by webmail.leidinger.net (DragonFly Mail Agent v0.13+ on webmail.leidinger.net); Wed, 14 Dec 2022 08:28:06 +0100 Date: Wed, 14 Dec 2022 08:28:06 +0100 Message-ID: <20221214082806.Horde.fnrSehaAFQsAtgLgj_MkKpA@webmail.leidinger.net> From: Alexander Leidinger To: "Bjoern A. Zeeb" , Kristof Provost Cc: freebsd-jail@freebsd.org Subject: Re: What's going on with vnets and epairs w/ addresses? In-Reply-To: <5r22os7n-ro15-27q-r356-rps331o06so5@mnoonqbm.arg> Accept-Language: de,en Content-Type: multipart/signed; boundary="=_u8b1FlGjBkWKpOnADRhAnyV"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 X-Rspamd-Queue-Id: 4NX6R93YVsz3nwy X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:34240, ipnet:89.238.64.0/18, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N This message is in MIME format and has been PGP signed. --=_u8b1FlGjBkWKpOnADRhAnyV Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting "Bjoern A. Zeeb" (from Tue, 13 Dec 2022=20=20 23:03:42=20+0000 (UTC)): > Hi, > > I have used scripts like the below for almost a decade and a half > (obviously doing more than that in the middle). I haven't used them > much lately but given other questions I just wanted to fire up a test. > > I have an end-November kernel doing the below my eapirs do not come back > to be destroyed (immediately). > I have to start polling for the jid to be no longer alive and not in > dying state (hence added the jls/ifconfig -l lines and removed the > error checking from ifconfig destroy). That seems sometimes rather > unreasonably long (to the point I give up). > > If I don't configure the addresses below this isn't a problem. > > Sorry I am confused by too many incarnations of the code; I know I once > had a version with an async shutdown path but I believe that never made > it into mainline, so why are we holding onto the epairs now and not > nuking the addresses and returning them and are clean? Kristof, isn't this (epair destruction in jails) one of the issues you=20= =20 looked=20at? Sorry if I remember incorrectly. What I have in my jails-shutdown is to do an "ifconfig $epair_in_jail=20=20 -vnet=20$jail; sleep 2; ifconfig $epair destroy". With this I don't see=20= =20 any=20issues, Everything is cleaned up when the stop finishes. Bye, Alexander. > It's a bit more funny; I added a twiddle loop at the end and nothing > happened. So I stop the script and start it again and suddenly another > jail or two have cleaned up and their epairs are back. Something feels > very very wonky. Play around with this and see ... and let me know if > you can reproduce this... I quite wonder why some test cases haven't > gone crazy ... > > /bz > > ------------------------------------------------------------------------ > #!/bin/sh > > set -e > set -x > > js=3D`jail -i -c -n jl host.hostname=3Dleft.example.net vnet persist` > jb=3D`jail -i -c -n jr host.hostname=3Dright.example.net vnet persist` > > # Create an epair connecting the two machines (vnet jails). > ep=3D`ifconfig epair create | sed -e 's/a$//'` > > # Add one end to each vnet jail. > ifconfig ${ep}a vnet ${js} > ifconfig ${ep}b vnet ${jb} > > # Add an IP address on the epairs in each vnet jail. > # XXX Leave these out and the cleanup seems to work fine. > jexec ${js} ifconfig ${ep}a inet 192.0.2.1/24 > jexec ${jb} ifconfig ${ep}b inet 192.0.2.2/24 > > # Clean up. > jail -r ${jb} > jail -r ${js} > > # You want to be able to remove this line ... > set +e > > # No epairs to destroy with addresses configured; fine otherwise. > ifconfig ${ep}a destroy > # echo $? > > # Add this is here only as things are funny ... > # jls -av jid dying > # ifconfig -l > > # end > ------------------------------------------------------------------------ > > --=20 >=20Bjoern A. Zeeb r15:= 7 --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_u8b1FlGjBkWKpOnADRhAnyV Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIzBAABCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmOZewUACgkQEg2wmwP4 2Iaeww/5AQdUYL0r/txzh4ftRY9NNDRMeD9U3Dzkmn59JOg+1yRGAFtVRd5E2dq2 NMYHgweNDDkuDxfOt0fHpdlGRkxA2x6OeguKB0F3kJjuG0Le9wcuTdCm9meMoyt2 QBjATXHQjLHfSM2ZHWr4lZXdAb5cMRUExQjRwneXnxLoRo86yhMHabiul2ufc8KC AnlCbZjgrRE7hc56s6Is0FeUkVL/yW2T26jus9YGU/JjUoJ3IaPlnWnEWwqP5seg 1Kdv1JD7Q0Zf5ABMZ/pdDiWIQhU4PIFwECYDyKNDMoRAAr0S2sNdNwIRH/5h0tdV ihomEvCZB+N/GSPuQGtHH5n4eaC8M2FO2khwJxCoRBiOclzESOOaQ5ZUtusR42j7 xw9ceILQs2cF4dh2lnDnEI0wFZ6YqsnFTAG24yd2JUZEzWxAyWR+v4qB+7EhtB3f 7t/A5tbxZ3yshfofGVATwCJsWydX0B7KGnQjmE1EcbyEX2bsRl5sx00p0X1Kqw67 JqbKEcNxzQX3R6deV0XvT2anG+II1+OTRZq15fKOf2ftxneeuBSWk39VeFHij6M/ HKBLmKh5P0s/4CHZZtcynnM9XnUK/ktvMSqgmzJ+F0yRnBOpXFIeuCZj32FYIb3r eTldv+DvZaFmZ7/6cTadhkWBJAoFcfPiRMrOVUREacyRFWuVJUQ= =D9Bc -----END PGP SIGNATURE----- --=_u8b1FlGjBkWKpOnADRhAnyV--