[PC-BSD Commits] r17379 - pcbsd/current/src-sh/warden/scripts/backend

svn at pcbsd.org svn at pcbsd.org
Thu Jun 21 11:59:36 PDT 2012


Author: kris
Date: 2012-06-21 18:59:36 +0000 (Thu, 21 Jun 2012)
New Revision: 17379

Modified:
   pcbsd/current/src-sh/warden/scripts/backend/startjail.sh
   pcbsd/current/src-sh/warden/scripts/backend/stopjail.sh
Log:

Mount some extra file systems within a linux jail



Modified: pcbsd/current/src-sh/warden/scripts/backend/startjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/startjail.sh	2012-06-21 18:49:17 UTC (rev 17378)
+++ pcbsd/current/src-sh/warden/scripts/backend/startjail.sh	2012-06-21 18:59:36 UTC (rev 17379)
@@ -66,6 +66,13 @@
   else
      mount -t linsysfs linsys "${JDIR}/${IP}/sys"
   fi
+  if [ -e "${JDIR}/${IP}/lib/init/rw" ] ; then
+    if is_symlinked_mountpoint ${JDIR}/${IP}/lib/init/rw; then
+       echo "${JDIR}/${IP}/lib/init/rw has symlink as parent, not mounting"
+    else
+       mount -t tmpfs tmpfs "${JDIR}/${IP}/lib/init/rw"
+    fi
+  fi
 else
   # FreeBSD Jail
   if is_symlinked_mountpoint ${JDIR}/${IP}/proc; then

Modified: pcbsd/current/src-sh/warden/scripts/backend/stopjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/stopjail.sh	2012-06-21 18:49:17 UTC (rev 17378)
+++ pcbsd/current/src-sh/warden/scripts/backend/stopjail.sh	2012-06-21 18:59:36 UTC (rev 17379)
@@ -91,6 +91,11 @@
   elif [ -e "${JDIR}/${IP}/etc/rc" ] ; then
     jexec ${JID} /bin/sh /etc/rc 0 2>&1
   fi
+
+  umount -f ${JDIR}/${IP}/sys
+  umount -f ${JDIR}/${IP}/dev/fd
+  umount -f ${JDIR}/${IP}/lib/init/rw >/dev/null 2>/dev/null
+
 else
   jexec ${JID} /bin/sh /etc/rc.shutdown >/dev/null 2>/dev/null
 fi
@@ -139,10 +144,9 @@
   done
 fi
 
-# Check if we need to unmount the proc in jail
+# Check if we need to unmount any extra dirs
 mount | grep "${JDIR}/${IP}/proc" >/dev/null 2>/dev/null
-if [ "$?" = "0" ]
-then
+if [ "$?" = "0" ]; then
   umount -f "${JDIR}/${IP}/proc"
 fi
 



More information about the Commits mailing list