From ef1fbf3ef93d18c2cb42712d009ff30da2f9046e Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 7 Aug 2005 23:19:02 +0000 Subject: Skip jails which are already running and inform why. We're checking for /var/run/jail_.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 --- etc/rc.d/jail | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'etc/rc.d') diff --git a/etc/rc.d/jail b/etc/rc.d/jail index 807550b..1281bb5 100644 --- a/etc/rc.d/jail +++ b/etc/rc.d/jail @@ -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 -- cgit v1.1