aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/rc.d/jail15
1 files changed, 10 insertions, 5 deletions
diff --git a/etc/rc.d/jail b/etc/rc.d/jail
index 8b9f3841aef4..3b4a4a51a1d5 100644
--- a/etc/rc.d/jail
+++ b/etc/rc.d/jail
@@ -221,11 +221,16 @@ jail_start()
_tmp_jail=${_tmp_dir}/jail.$$
eval jail ${jail_flags} -i ${jail_rootdir} ${jail_hostname} \
${jail_ip} ${jail_exec_start} > ${_tmp_jail} 2>&1
- [ "$?" -eq 0 ] && echo -n " $jail_hostname"
- _jail_id=$(head -1 ${_tmp_jail})
- tail +2 ${_tmp_jail} >${jail_rootdir}/var/log/console.log
+ if [ "$?" -eq 0 ] ; then
+ echo -n " $jail_hostname"
+ _jail_id=$(head -1 ${_tmp_jail})
+ tail +2 ${_tmp_jail} >${jail_rootdir}/var/log/console.log
+ echo ${_jail_id} > /var/run/jail_${_jail}.id
+ else
+ echo " cannot start jail \"${_jail}\": "
+ tail +2 ${_tmp_jail}
+ fi
rm -f ${_tmp_jail}
- echo ${_jail_id} > /var/run/jail_${_jail}.id
done
rmdir ${_tmp_dir}
echo '.'
@@ -255,7 +260,7 @@ jail_stop()
fi
rm /var/run/jail_${_jail}.id
else
- echo "cannot stop jail ${_jail}. No jail id in /var/run"
+ echo " cannot stop jail ${_jail}. No jail id in /var/run"
fi
done
echo '.'