Summary: | [patch] request for new functionality. jail zfs dataset on jail start up by /etc/rc.d/jail | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Valery Smirnov <freebsd-pr> | ||||
Component: | conf | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | Closed Overcome By Events | ||||||
Severity: | Affects Only Me | CC: | bdrewery, netchild | ||||
Priority: | Normal | Keywords: | patch | ||||
Version: | Unspecified | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194105 | ||||||
Attachments: |
|
Description
Valery Smirnov
2011-02-03 11:30:09 UTC
State Changed From-To: open->feedback sorry, looks like the patch got stripped. Can you re-send? Yes, please. Sorry for double sent. On Thu, 3 Feb 2011 12:36:05 GMT, linimon@FreeBSD.org wrote: > Synopsis: [patch] request for new functionality. jail zfs dataset on > jail start up by /etc/rc.d/jail > > State-Changed-From-To: open->feedback > State-Changed-By: linimon > State-Changed-When: Thu Feb 3 12:35:46 UTC 2011 > State-Changed-Why: > sorry, looks like the patch got stripped. Can you re-send? > > http://www.freebsd.org/cgi/query-pr.cgi?pr=154484 -- Best regards mailto: freebsd-pr@smirnov.tv Valery V.Smirnov State Changed From-To: feedback->open patch received. For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped We need "zfs jail" between jail(2) and "jexec sh /etc/rc". exec.created fits there. This works: exec.created = "zfs jail $name pool/dataset" For rc.d/jail though I had to use this patch: --- /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 = \"root\";" echo " exec.jail_user = \"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 "" There is no good place for a "zfs unjail" though. We need "zfs unjail" between "jexec sh /etc/rc.shutdown" and jail_remove(2). I think most of the patch here does not apply anymore and jail(8) handles executing commands itself. If we add a spot between stop and IP__OP that executes in the system it should work. Very incomplete example of where to start on a proper patch: diff --git usr.sbin/jail/jail.c usr.sbin/jail/jail.c index 63096146f176..13bbfe5f69e3 100644 --- usr.sbin/jail/jail.c +++ usr.sbin/jail/jail.c @@ -114,6 +114,7 @@ static const enum intparam stopcommands[] = { IP_EXEC_PRESTOP, IP_EXEC_STOP, IP_STOP_TIMEOUT, + IP_EXEC_STOPPED, IP__OP, IP_EXEC_POSTSTOP, IP_MOUNT_PROCFS, Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi> Native zfs dataset support was added to jail(8) in -current (_FreeBSD_version 1500011). |