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
This patch adds another hook called exec.started: https://reviews.freebsd.org/D15330
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 Log: - 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 jail. PR: 228066 [1] Reviewed by: jamie [1] Submitted by: Stefan Gr?nke <stefan@gronke.net> [1] Differential Revision: https://reviews.freebsd.org/D15330 [1] Changes: head/sys/sys/param.h head/usr.sbin/jail/command.c head/usr.sbin/jail/config.c head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.c head/usr.sbin/jail/jailp.h
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. Thanks