From nobody Wed Jun 08 05:00:39 2022 X-Original-To: ports-bugs@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 F1726840337 for ; Wed, 8 Jun 2022 05:00:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LHw605nt1z3mb3 for ; Wed, 8 Jun 2022 05:00:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7C1E11AA for ; Wed, 8 Jun 2022 05:00:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 25850emm092102 for ; Wed, 8 Jun 2022 05:00:40 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 25850eKu092101 for ports-bugs@FreeBSD.org; Wed, 8 Jun 2022 05:00:40 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 194105] sysutils/ezjail with zfs_datasets does not work with /etc/rc.d/zfs Date: Wed, 08 Jun 2022 05:00:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bdrewery@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654664440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5ilTfV3K0f27kAkmr4cGT5SuOwYyWc30rnuKhjQl8uU=; b=v0WEFFu8ivhpAVvXLk5MRm1fhkO7NRWIbzZeCUU7AwTExEJHsV6+yKUoiS3EtkR9fbwK4H fa9EPsUV1m69NEYOpqJpq8x9c2/hk2pSSANSQiT+at7V1wWC9Wi25T+WfNFoEuTfshS3LS eFF4q9gSns5i1esifoMoqsFpAX5oLaj4DglZu7llGhT601nj0cDy09RLp7Azxkjyb0i0Z/ z1N0XVyfP+N8Tn2VtAv3PfSOYy9kDbHIqmTT6sIQvNtUtR4L4PfuMdlUmFcD0uneXCr40F 78aEyNzqDPddHfkKqLgehYT4DppiNDxO98qIa2uYL7zjN2MLyJNiLt1BH3IGPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654664440; a=rsa-sha256; cv=none; b=wix80ehXy0dR/CRsgQhvlQhxgjGtCJWf1cO78JzgZ8qEuGsqmq3j5zIuTn3dLvHC1zOZKg N6u1j/K4JlJvRIppSQ3pZUQNP3tcAhVnHB/Nm76c2QNfCNm3yk1EIdEbQyp9T+O2zxAefw 4Yu5fOwtPurkZqUI/ZnfHLknAn6UFmZxAISxJCnjjxMHDJ+bOY8ZBwteMtDplYnTSn1dCn a33iQrJ0T/ISsCO/CNkEA94pX6vYvF1+lcYj7sBf2L0ARyAupGUbJAnq4cG+Eo/QhnmpuW EIEM8ZPk+2a0flWD4jMnIGueF4tUVWgFYU1PDY4R5p/3otyIC6iSgyjl11s3Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D194105 --- Comment #5 from Bryan Drewery --- Yup this is still relevant. A simple workaround for *startup* is to use exec.created. exec.poststart is too late if you want rc scripts depending on the zfs dataset. exec.start before /etc/rc might work but I didn't try. To be clear the "zfs jail" needs to occur between jail(2) and jexec "sh /etc/rc". --- /tmp/jail 2022-06-07 21:56:17.886298000 -0700 +++ /etc/rc.d/jail 2022-06-07 21:56:19.863706000 -0700 @@ -213,6 +213,7 @@ parse_options() echo " exec.system_user =3D \"root\";" echo " exec.jail_user =3D \"root\";" extract_var $_jv exec_prestart exec.prestart 0 "" + extract_var $_jv exec_created exec.created - "" extract_var $_jv exec_poststart exec.poststart 0 "" extract_var $_jv exec_prestop exec.prestop 0 "" extract_var $_jv exec_poststop exec.poststop 0 "" Then in the ezjail/jail.conf file something like this: # Must not set zfs_datasets or /usr/local/etc/rc.d/ezjail does the "zfs jai= l" too late (which is ignored but causes a warning) export jail_backups_exec_created=3D"zfs jail \$name backup" There is no corresponding place in the jail stop to do "zfs unjail". It nee= ds to occur after /etc/rc.shutdown but before jail_remove(2). jail.*stop* are = all just wrong for this. In practice the "zfs unjail" piece does not seem impor= tant but I could be wrong. iocage avoids all of this by not using /etc/rc.d/jail like ezjail does. It = uses jail(8) and controls the ordering properly. --=20 You are receiving this mail because: You are the assignee for the bug.=