[PC-BSD Commits] r17377 - in pcbsd/current/src-sh/warden: . linux-installs scripts/backend

svn at pcbsd.org svn at pcbsd.org
Thu Jun 21 11:10:03 PDT 2012


Author: kris
Date: 2012-06-21 18:10:01 +0000 (Thu, 21 Jun 2012)
New Revision: 17377

Added:
   pcbsd/current/src-sh/warden/linux-installs/
   pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze
Modified:
   pcbsd/current/src-sh/warden/install.sh
   pcbsd/current/src-sh/warden/scripts/backend/createjail.sh
   pcbsd/current/src-sh/warden/scripts/backend/deletejail.sh
   pcbsd/current/src-sh/warden/scripts/backend/listjails.sh
   pcbsd/current/src-sh/warden/scripts/backend/startjail.sh
Log:

Add new linux-install script for debian-6-suqeeze
Fix some bugs creating linux jails
Show jail type as linux



Modified: pcbsd/current/src-sh/warden/install.sh
===================================================================
--- pcbsd/current/src-sh/warden/install.sh	2012-06-21 17:09:42 UTC (rev 17376)
+++ pcbsd/current/src-sh/warden/install.sh	2012-06-21 18:10:01 UTC (rev 17377)
@@ -33,6 +33,11 @@
    sed -i '' "s|$OJDIR|JDIR: $JDIR|g" /usr/local/etc/warden.conf
 fi
 
+if [ -d "${PROGDIR}/linux-installs" ] ; then
+  rm -rf ${PROGDIR}/linux-installs
+fi
+cp -r linux-installs ${PROGDIR}
+
 if [ -d "${PROGDIR}/scripts" ] ; then
   rm -rf ${PROGDIR}/scripts
 fi

Index: pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze
===================================================================
--- pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze	2012-06-21 17:09:42 UTC (rev 17376)
+++ pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze	2012-06-21 18:10:01 UTC (rev 17377)

Property changes on: pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Modified: pcbsd/current/src-sh/warden/scripts/backend/createjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/createjail.sh	2012-06-21 17:09:42 UTC (rev 17376)
+++ pcbsd/current/src-sh/warden/scripts/backend/createjail.sh	2012-06-21 18:10:01 UTC (rev 17377)
@@ -23,9 +23,10 @@
   # Create the master.passwd
   echo "root::0:0::0:0:Charlie &:/root:/bin/bash" > ${JDIR}/${IP}/etc/master.passwd
   pwd_mkdb -d ${JDIR}/${IP}/tmp -p ${JDIR}/${IP}/etc/master.passwd
-  mv ${JDIR}/${IP}/master.passwd ${JDIR}/${IP}/etc/
-  mv ${JDIR}/${IP}/pwd.db ${JDIR}/${IP}/etc/
-  mv ${JDIR}/${IP}/spwd.db ${JDIR}/${IP}/etc/
+  mv ${JDIR}/${IP}/tmp/master.passwd ${JDIR}/${IP}/etc/
+  mv ${JDIR}/${IP}/tmp/pwd.db ${JDIR}/${IP}/etc/
+  mv ${JDIR}/${IP}/tmp/spwd.db ${JDIR}/${IP}/etc/
+  rm ${JDIR}/${IP}/tmp/passwd
 
   # Copy resolv.conf
   cp /etc/resolv.conf ${JDIR}/${IP}/etc/resolv.conf
@@ -45,7 +46,7 @@
 ln -s /bin/true umount
 ' > ${JDIR}/${IP}/.fixSH
   chmod 755 ${JDIR}/${IP}/.fixSH
-  chroot ${JDIR}/${IP} /.fixSH
+  chroot ${JDIR}/${IP} /.fixSH >/dev/null 2>/dev/null
   rm ${JDIR}/${IP}/.fixSH
 
   # If we are auto-starting the jail, do it now

Modified: pcbsd/current/src-sh/warden/scripts/backend/deletejail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/deletejail.sh	2012-06-21 17:09:42 UTC (rev 17376)
+++ pcbsd/current/src-sh/warden/scripts/backend/deletejail.sh	2012-06-21 18:10:01 UTC (rev 17377)
@@ -51,7 +51,7 @@
   rm -rf "${JDIR}/${IP}"
 fi
 
-if [ ! -z "${JMETADIR}" -a "${JMETADIR} != " " ] ; then
+if [ ! -z "${JMETADIR}" -a "${JMETADIR}" != " " ] ; then
   rm -rf "${JMETADIR}"
 fi
 

Modified: pcbsd/current/src-sh/warden/scripts/backend/listjails.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/listjails.sh	2012-06-21 17:09:42 UTC (rev 17376)
+++ pcbsd/current/src-sh/warden/scripts/backend/listjails.sh	2012-06-21 18:10:01 UTC (rev 17377)
@@ -44,6 +44,8 @@
   # Figure out the type of jail
   if [ -e "${i}/xjail" ] ; then
     TYPE="portjail"
+  elif [ -e "${i}/linuxjail" ] ; then
+    TYPE="linuxjail"
   else
     TYPE="standard"
   fi

Modified: pcbsd/current/src-sh/warden/scripts/backend/startjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/startjail.sh	2012-06-21 17:09:42 UTC (rev 17376)
+++ pcbsd/current/src-sh/warden/scripts/backend/startjail.sh	2012-06-21 18:10:01 UTC (rev 17377)
@@ -56,6 +56,16 @@
   else
      mount -t linprocfs linproc "${JDIR}/${IP}/proc"
   fi
+  if is_symlinked_mountpoint ${JDIR}/${IP}/dev/fd; then
+     echo "${JDIR}/${IP}/dev/fd has symlink as parent, not mounting"
+  else
+     mount -t fdescfs null "${JDIR}/${IP}/dev/fd"
+  fi
+  if is_symlinked_mountpoint ${JDIR}/${IP}/sys; then
+     echo "${JDIR}/${IP}/sys has symlink as parent, not mounting"
+  else
+     mount -t linsysfs linsys "${JDIR}/${IP}/sys"
+  fi
 else
   # FreeBSD Jail
   if is_symlinked_mountpoint ${JDIR}/${IP}/proc; then



More information about the Commits mailing list