Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Jun 2022 05:00:39 +0000
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
Message-ID:  <bug-194105-7788-93jwyMolY1@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-194105-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-194105-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D194105

--- Comment #5 from Bryan Drewery <bdrewery@FreeBSD.org> ---
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-194105-7788-93jwyMolY1>