diff options
author | pjd <pjd@FreeBSD.org> | 2005-08-07 23:19:02 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-08-07 23:19:02 +0000 |
commit | ef1fbf3ef93d18c2cb42712d009ff30da2f9046e (patch) | |
tree | fe0248df5e25e8afec02019dfedb5cf2381bc0d9 /etc/rc.d/jail | |
parent | 58e0c658057c3600f5517b2362996f811104bedf (diff) | |
download | FreeBSD-src-ef1fbf3ef93d18c2cb42712d009ff30da2f9046e.zip FreeBSD-src-ef1fbf3ef93d18c2cb42712d009ff30da2f9046e.tar.gz |
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
Diffstat (limited to 'etc/rc.d/jail')
-rw-r--r-- | etc/rc.d/jail | 4 |
1 files changed, 4 insertions, 0 deletions
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 |