Don't start empty jails, don't apply template if Bastillefile is empty
This commit is contained in:
@@ -353,7 +353,9 @@ create_jail() {
|
|||||||
chmod 0700 "${bastille_jailsdir}/${NAME}"
|
chmod 0700 "${bastille_jailsdir}/${NAME}"
|
||||||
|
|
||||||
# Jail must be started before applying the default template. -- cwells
|
# Jail must be started before applying the default template. -- cwells
|
||||||
|
if [ -z "${EMPTY_JAIL}" ]; then
|
||||||
bastille start "${NAME}"
|
bastille start "${NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${VNET_JAIL}" ]; then
|
if [ -n "${VNET_JAIL}" ]; then
|
||||||
if [ -n ${bastille_template_vnet} ]; then
|
if [ -n ${bastille_template_vnet} ]; then
|
||||||
@@ -378,8 +380,10 @@ create_jail() {
|
|||||||
fi
|
fi
|
||||||
elif [ -n "${EMPTY_JAIL}" ]; then
|
elif [ -n "${EMPTY_JAIL}" ]; then
|
||||||
if [ -n ${bastille_template_empty} ]; then
|
if [ -n ${bastille_template_empty} ]; then
|
||||||
|
if [ -s ${bastille_templatesdir}/${bastille_template_empty}/Bastillefile ]; then
|
||||||
bastille template "${NAME}" ${bastille_template_empty} --arg BASE_TEMPLATE="${bastille_template_base}" --arg HOST_RESOLV_CONF="${bastille_resolv_conf}"
|
bastille template "${NAME}" ${bastille_template_empty} --arg BASE_TEMPLATE="${bastille_template_base}" --arg HOST_RESOLV_CONF="${bastille_resolv_conf}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
else # Thin jail.
|
else # Thin jail.
|
||||||
if [ -n ${bastille_template_thin} ]; then
|
if [ -n ${bastille_template_thin} ]; then
|
||||||
bastille template "${NAME}" ${bastille_template_thin} --arg BASE_TEMPLATE="${bastille_template_base}" --arg HOST_RESOLV_CONF="${bastille_resolv_conf}"
|
bastille template "${NAME}" ${bastille_template_thin} --arg BASE_TEMPLATE="${bastille_template_base}" --arg HOST_RESOLV_CONF="${bastille_resolv_conf}"
|
||||||
@@ -387,7 +391,9 @@ create_jail() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply values changed by the template. -- cwells
|
# Apply values changed by the template. -- cwells
|
||||||
|
if [ -z "${EMPTY_JAIL}" ]; then
|
||||||
bastille restart "${NAME}"
|
bastille restart "${NAME}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle special-case commands first.
|
# Handle special-case commands first.
|
||||||
|
|||||||
Reference in New Issue
Block a user