freebsd-skq/usr.sbin/jail
freqlabs 9fcd25b7d7 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
2020-05-14 23:38:11 +00:00
..
tests [jail] removal by jid doesn't trigger pre/post stop scripts 2019-09-12 18:53:29 +00:00
command.c jail: Add exec.prepare and exec.release command hooks 2020-05-14 23:38:11 +00:00
config.c jail: Add exec.prepare and exec.release command hooks 2020-05-14 23:38:11 +00:00
jail.8 jail: Add exec.prepare and exec.release command hooks 2020-05-14 23:38:11 +00:00
jail.c jail: Add exec.prepare and exec.release command hooks 2020-05-14 23:38:11 +00:00
jail.conf.5 add ability to set watchdog timeout for a shutdown 2019-10-03 11:23:10 +00:00
jaillex.l
jailp.h jail: Add exec.prepare and exec.release command hooks 2020-05-14 23:38:11 +00:00
jailparse.y
Makefile revert r354935 and apply fix for cleandir failure 2019-11-21 13:56:16 +00:00
Makefile.depend
state.c [jail] removal by jid doesn't trigger pre/post stop scripts 2019-09-12 18:53:29 +00:00