]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r361066:
authorRyan Moeller <freqlabs@FreeBSD.org>
Thu, 21 May 2020 02:04:10 +0000 (02:04 +0000)
committerRyan Moeller <freqlabs@FreeBSD.org>
Thu, 21 May 2020 02:04:10 +0000 (02:04 +0000)
commita13d27861cec3bdd26b6be1d93b36b94452c8b5d
tree336a73c0848d1504120ea8ab1c485920d258f106
parent52347b77f5d48d9a236fbfd364ff067bebd29baf
MFC r361066:

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)
Differential Revision:  https://reviews.freebsd.org/D24829
usr.sbin/jail/command.c
usr.sbin/jail/config.c
usr.sbin/jail/jail.8
usr.sbin/jail/jail.c
usr.sbin/jail/jailp.h