mirror of
https://github.com/BastilleBSD/bastille.git
synced 2025-12-11 01:19:52 +01:00
docs: zfs: remove template section
This commit is contained in:
@@ -85,8 +85,8 @@ and being able to fully manage it from within the jail.
|
|||||||
|
|
||||||
To add a dataset to a jail, we can run
|
To add a dataset to a jail, we can run
|
||||||
``bastille zfs TARGET jail pool/dataset /path/inside/jail``.
|
``bastille zfs TARGET jail pool/dataset /path/inside/jail``.
|
||||||
This will mount ``pool/dataset`` into the jail at ``/path/inside/jail`` when the
|
This will assign ``pool/dataset`` to the jail and mount it
|
||||||
jail is started, and unmount and unjail it when the jail is stopped.
|
at ``/path/inside/jail``.
|
||||||
|
|
||||||
You can manually change the path where the dataset will be mounted by
|
You can manually change the path where the dataset will be mounted by
|
||||||
``bastille edit TARGET zfs.conf`` and adjusting the path after you have added it,
|
``bastille edit TARGET zfs.conf`` and adjusting the path after you have added it,
|
||||||
@@ -105,34 +105,5 @@ simple.
|
|||||||
To remove a dataset from being jailed, we can run
|
To remove a dataset from being jailed, we can run
|
||||||
``bastille zfs TARGET unjail pool/dataset``.
|
``bastille zfs TARGET unjail pool/dataset``.
|
||||||
|
|
||||||
Template Approach
|
NOTE: You must unjail any jailed datasets before attempting to destroy
|
||||||
^^^^^^^^^^^^^^^^^
|
a jail.
|
||||||
|
|
||||||
While it is possible to "jail" a dataset using a template, it is a bit more
|
|
||||||
"hacky" than the above apporach.
|
|
||||||
Below is a template that you can use that will add the necessary bits to the
|
|
||||||
``jail.conf`` file to "jail" a dataset.
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
ARG JAIL_NAME
|
|
||||||
ARG DATASET
|
|
||||||
ARG MOUNT
|
|
||||||
|
|
||||||
CONFIG set allow.mount
|
|
||||||
CONFIG set allow.mount.devfs
|
|
||||||
CONFIG set allow.mount.zfs
|
|
||||||
CONFIG set enforce_statfs 1
|
|
||||||
|
|
||||||
CONFIG set "exec.created += '/sbin/zfs jail ${JAIL_NAME} ${DATASET}'"
|
|
||||||
CONFIG set "exec.start += '/sbin/zfs set mountpoint=${MOUNT} ${DATASET}'"
|
|
||||||
|
|
||||||
RESTART
|
|
||||||
|
|
||||||
CONFIG set "exec.prestop += 'jexec -l -U root ${JAIL_NAME} /sbin/zfs umount ${DATASET}'"
|
|
||||||
CONFIG set "exec.prestop += '/sbin/zfs unjail ${JAIL_NAME} ${DATASET}'"
|
|
||||||
|
|
||||||
RESTART
|
|
||||||
|
|
||||||
This template can be applied using ``bastille template TARGET project/template --arg DATASET=zpool/dataset --arg MOUNT=/path/inside/jail``.
|
|
||||||
We do not need the ``JAIL_NAME`` arg, as it will be auto-filled from the supplied ``TARGET`` name.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user