Skip jails which are already running and inform why.
We're checking for /var/run/jail_<name>.id file and if it exists, we don't start the jail. It should be also safe in case of reboot(8), because rc.d/cleanvar script is going to remove /var/run/jail_* files. It helps to avoid potential mess when the same jail is started twice, because of an administrator mistake (been there, done that). MFC after: 1 week
This commit is contained in:
parent
3dd22bbe78
commit
5b3e518936
@ -158,6 +158,10 @@ jail_start()
|
||||
for _jail in ${jail_list}
|
||||
do
|
||||
init_variables $_jail
|
||||
if [ -f /var/run/jail_${_jail}.id ]; then
|
||||
echo -n " [${jail_hostname} already running (/var/run/jail_${_jail}.id exists)]"
|
||||
continue;
|
||||
fi
|
||||
if checkyesno jail_mount; then
|
||||
info "Mounting fstab for jail ${_jail} (${jail_fstab})"
|
||||
if [ ! -f "${jail_fstab}" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user