svn commit: r258278 - user/nwhitehorn/condorports/altjailscripts/fuse-unionfs

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sun Nov 17 21:33:33 UTC 2013


Author: nwhitehorn
Date: Sun Nov 17 21:33:32 2013
New Revision: 258278
URL: http://svnweb.freebsd.org/changeset/base/258278

Log:
  These use FUSE's unionfs implementation, which is much better. However,
  our FUSE kernel support is *also* a crashfest.

Added:
  user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/
  user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/prepbuildjail
     - copied, changed from r258277, user/nwhitehorn/condorports/prepbuildjail
  user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/reapbuildjail
     - copied, changed from r258277, user/nwhitehorn/condorports/reapbuildjail

Copied and modified: user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/prepbuildjail (from r258277, user/nwhitehorn/condorports/prepbuildjail)
==============================================================================
--- user/nwhitehorn/condorports/prepbuildjail	Sun Nov 17 21:31:11 2013	(r258277, copy source)
+++ user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/prepbuildjail	Sun Nov 17 21:33:32 2013	(r258278)
@@ -1,7 +1,6 @@
 #!/bin/sh
 slot=$1
 release=$2
-ports=$3
 
 #Audit slot and release names
 case $slot in
@@ -10,9 +9,6 @@ esac
 case $release in
 	*[^a-zA-Z0-9]* ) echo "Non-alphanumeric release $release"; exit 1
 esac
-case $ports in
-	*[^a-zA-Z0-9/-]* ) echo "Non-alphanumeric ports $ports"; exit 1
-esac
 if [ -z "$slot" -o -z "$release" ]; then
 	echo "Zero-length slot or release"
 	exit 1
@@ -21,6 +17,7 @@ fi
 if [ -d /scratch/$slot ]; then
 	echo "Pre-existing file system for this slot!"
 	/pkgscripts/reapbuildjail $slot
+	sleep 5
 fi
 
 cleanup() {
@@ -34,33 +31,10 @@ trap cleanup EXIT
 
 #TODO: localhost networking
 
-set -o noclobber
-echo > /scratch/$slot.lock
-
-set +o noclobber
-cat << EOF > /scratch/$slot.conf
-$slot {
-	path="/scratch/$slot";
-	host.hostname="$slot.`hostname`";
-	persist="true";
-	mount.devfs="true";
-	mount.fstab="/scratch/$slot.fstab";
-}
-EOF
-# TODO: Setting nosuid seems to break "below"
-echo "/scratch/$release /scratch/$slot unionfs below,noatime 0 0" > /scratch/$slot.fstab
-if [ -n "$ports" ]; then
-	mkdir -p /scratch/$slot/$ports
-	echo "$ports /scratch/$slot/$ports nullfs ro 0 0" >> /scratch/$slot.fstab
-fi
-
 mkdir -p /scratch/$slot
+mkdir -p /scratch/tmp/$slot
+unionfs -o cow -o noatime -o nosuid -o max_files=32000 /scratch/tmp/$slot=RW:/scratch/ports=RO:/scratch/$release=RO /scratch/$slot
 
-jail -f /scratch/$slot.conf -c $slot
-ls /scratch/$slot/dev > /dev/null # Hack around unionfs bugs
-if [ -n "$ports" ]; then
-	ls /scratch/$slot/$ports > /dev/null # And once more
-fi
+jail -c name=$slot path=/scratch/$slot host.hostname=$slot.`hostname` persist=true mount.devfs=true
 trap true EXIT
-rm /scratch/$slot.lock
 

Copied and modified: user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/reapbuildjail (from r258277, user/nwhitehorn/condorports/reapbuildjail)
==============================================================================
--- user/nwhitehorn/condorports/reapbuildjail	Sun Nov 17 21:31:11 2013	(r258277, copy source)
+++ user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/reapbuildjail	Sun Nov 17 21:33:32 2013	(r258278)
@@ -15,12 +15,9 @@ if [ ! -d /scratch/$slot ]; then
 	exit 1
 fi
 
-set +e
-set -o noclobber
-echo > /scratch/$slot.lock
-jail -f /scratch/$slot.conf -r $slot
-chflags -R noschg /scratch/$slot
-rm -rf /scratch/$slot /scratch/$slot.conf /scratch/$slot.fstab
-set +e
-rm /scratch/$slot.lock
-
+jail -r $slot
+umount -f /scratch/$slot/dev || true
+umount -f /scratch/$slot || true
+chflags -R noschg /scratch/tmp/$slot
+rm -rf /scratch/tmp/$slot /scratch/$slot
+exit 0


More information about the svn-src-user mailing list