HomeFreeBSD

jail: Add exec.prepare and exec.release command hooks

Description

jail: Add exec.prepare and exec.release command hooks

This change introduces new jail command hooks that run before and after any
other actions.

The exec.prepare hook can be used for example to invoke a script that checks
if the jail's root exists, creating it if it does not. Since arbitrary
variables in jail.conf can be passed to the command, it can be pretty useful
for templating jails.

An example use case for exec.release would be to remove the filesystem of an
ephemeral jail.

The names "prepare" and "release" are borrowed from the names of similar hooks
in libvirt.

Reviewed by: jamie, manpages, mmacy
Approved by: mmacy (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24829

Details

Provenance
freqlabsAuthored on
Reviewer
jamie
Differential Revision
D24829: jail: Add exec.prepare and exec.release command hooks
Parents
rS361065: pf tests: fix up a couple WARNS= 6 nits
Branches
Unknown
Tags
Unknown