Bug 228066 - Jail hook missing between launch and exec.start
Summary: Jail hook missing between launch and exec.start
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-jail mailing list
Keywords: patch
Depends on:
Reported: 2018-05-08 10:54 UTC by gronke
Modified: 2019-01-21 22:04 UTC (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description gronke 2018-05-08 10:54:59 UTC
There currently is no jail launch hook available between the launch of a jail and the internal execution of exec.start.

When there is a task that needs to be done on host side that requires the jail to be running (or needs to know its JID), another hook is required.

Right now vnet.interface does only allow to specify one vnet interface that is attached to the jail, but it would be need to have a generic hook that allows adding them manually.

More tasks that require another jail hook on host-side:

- Attaching ZFS storage before the exec.start or command executes
- Attaching multiple VNET interfaces
- Configuring the firewall on the host
Comment 1 gronke 2018-05-08 10:55:41 UTC
This patch adds another hook called exec.started:

Comment 2 commit-hook freebsd_committer 2018-08-15 18:35:52 UTC
A commit references this bug:

Author: netchild
Date: Wed Aug 15 18:35:43 UTC 2018
New revision: 337863
URL: https://svnweb.freebsd.org/changeset/base/337863

  - Add exec hook "exec.created". This is called when the jail is
    created and before exec.start is called.			[1]
  - Bump __FreeBSD_version.

  This allows to attach ZFS datasets and various other things to be
  done before any command/service/rc-script is started in the new

  PR:			228066					[1]
  Reviewed by:		jamie					[1]
  Submitted by:		Stefan Gr?nke <stefan@gronke.net>	[1]
  Differential Revision:	https://reviews.freebsd.org/D15330	[1]

Comment 3 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 22:04:09 UTC
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved.