Merge pull request #106 from cedwards/template_support_limits

add/remove rctl limits on container start/stop
This commit is contained in:
Christer Edwards
2020-01-26 10:10:36 -07:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -67,6 +67,13 @@ for _jail in ${JAILS}; do
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -c ${_jail}
## add rctl limits
if [ -s "${bastille_jailsdir}/${_jail}/rctl.conf" ]; then
while read _limits; do
rctl -a "${_limits}"
done < "${bastille_jailsdir}/${_jail}/rctl.conf"
fi
## add ip4.addr to firewall table:jails
if [ ! -z "${bastille_jail_loopback}" ]; then
pfctl -q -t jails -T add $(jls -j ${_jail} ip4.addr)

View File

@@ -69,6 +69,13 @@ for _jail in ${JAILS}; do
pfctl -q -t jails -T delete $(jls -j ${_jail} ip4.addr)
fi
## remove rctl limits
if [ -s "${bastille_jailsdir}/${_jail}/rctl.conf" ]; then
while read _limits; do
rctl -r "${_limits}"
done < "${bastille_jailsdir}/${_jail}/rctl.conf"
fi
## stop container
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -r ${_jail}