[PC-BSD Commits] r19823 - in pcbsd/current/src-sh/warden: bin scripts/backend
svn at pcbsd.org
svn at pcbsd.org
Fri Oct 19 15:07:12 PDT 2012
Author: kris
Date: 2012-10-19 22:07:12 +0000 (Fri, 19 Oct 2012)
New Revision: 19823
Modified:
pcbsd/current/src-sh/warden/bin/warden
pcbsd/current/src-sh/warden/scripts/backend/functions.sh
pcbsd/current/src-sh/warden/scripts/backend/importjail.sh
Log:
Fix old style meta-data, and get rid of error importing linux jails
Modified: pcbsd/current/src-sh/warden/bin/warden
===================================================================
--- pcbsd/current/src-sh/warden/bin/warden 2012-10-19 21:56:54 UTC (rev 19822)
+++ pcbsd/current/src-sh/warden/bin/warden 2012-10-19 22:07:12 UTC (rev 19823)
@@ -525,6 +525,9 @@
};
+# Fix old style meta-data, can be removed after 9.1
+fix_old_meta
+
# Check what the user wants to do
case "$1" in
Modified: pcbsd/current/src-sh/warden/scripts/backend/functions.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/functions.sh 2012-10-19 21:56:54 UTC (rev 19822)
+++ pcbsd/current/src-sh/warden/scripts/backend/functions.sh 2012-10-19 22:07:12 UTC (rev 19823)
@@ -274,3 +274,16 @@
# Restart cron
/etc/rc.d/cron restart >/dev/null 2>/dev/null
}
+
+fix_old_meta()
+{
+ for i in `ls -d ${JDIR}/.*.meta 2>/dev/null`
+ do
+ if [ -e "${i}/xjail" ] ; then
+ touch ${i}/jail-portjail 2>/dev/null
+ fi
+ if [ -e "${i}/linuxjail" ] ; then
+ touch ${i}/jail-linuxjail 2>/dev/null
+ fi
+ done
+}
Modified: pcbsd/current/src-sh/warden/scripts/backend/importjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/importjail.sh 2012-10-19 21:56:54 UTC (rev 19822)
+++ pcbsd/current/src-sh/warden/scripts/backend/importjail.sh 2012-10-19 22:07:12 UTC (rev 19823)
@@ -175,15 +175,16 @@
fi
# Create the host for this device
-if [ "${HOST}" != "OFF" -a ! -z "${HOST}" ]
-then
+if [ "${HOST}" != "OFF" -a ! -z "${HOST}" ]; then
# Save the details to the .wardenhost file
echo "${HOST}" >"${JMETADIR}/host"
# Change the hostname in rc.conf
- cat "${JDIR}/${IP}/etc/rc.conf" | grep -v "hostname=" >${JDIR}/${IP}/.rc.conf
- echo "hostname=\"${HOST}\"" >>"${JDIR}/${IP}/.rc.conf"
- mv "${JDIR}/${IP}/.rc.conf" "${JDIR}/${IP}/etc/rc.conf"
+ if [ -e "${JDIR}/${IP}/etc/rc.conf" ] ; then
+ cat "${JDIR}/${IP}/etc/rc.conf" | grep -v "hostname=" >${JDIR}/${IP}/.rc.conf
+ echo "hostname=\"${HOST}\"" >>"${JDIR}/${IP}/.rc.conf"
+ mv "${JDIR}/${IP}/.rc.conf" "${JDIR}/${IP}/etc/rc.conf"
+ fi
# Setup /etc/hosts now
echo "# : src/etc/hosts,v 1.16 2003/01/28 21:29:23 dbaker Exp $
More information about the Commits
mailing list