On Fri, May 13, 2011 at 10:53:52PM +0200, Tollef Fog Heen wrote:
> ]] Roger Leigh 
> 
> | I assume from the existing breakage that /any/ autofs mountpoint
> | is unsuitable for bind mounting?
> 
> Looks like it.  I think that's a kernel bug that we should just get
> fixed.  If we do so, the whole problem goes away.  I have no idea how
> easy or not that is, though.

Are the kernel folks aware of this issue?  Given that systemd is
exercising autofs in a way not seen much before (I've only ever
used it on /net for NFS automounting), it's likely we're the first
to run into problems.

I'm thinking of applying something like this to schroot to fix
things up.  It removes all the rbinds; if uses want fancier
mounts, then they will need to add them.  As and when the autofs
issue is fixed, we can look at adding back the rbinds.  Note it's
just a work in progress, so not fully tidied/ordered yet.


Regards,
Roger


diff --git a/etc/profile-templates/all/linux/fstab 
b/etc/profile-templates/all/linux/fstab
index 013098e..e40e881 100644
--- a/etc/profile-templates/all/linux/fstab
+++ b/etc/profile-templates/all/linux/fstab
@@ -1,2 +1,2 @@
-/proc          /proc           none    rw,rbind        0       0
-/sys           /sys            none    rw,rbind        0       0
+/proc          /proc           none    rw,bind        0       0
+/sys           /sys            none    rw,bind        0       0
diff --git a/etc/profile-templates/buildd/linux/fstab 
b/etc/profile-templates/buildd/linux/fstab
index 8ebf49d..5964de1 100644
--- a/etc/profile-templates/buildd/linux/fstab
+++ b/etc/profile-templates/buildd/linux/fstab
@@ -1,3 +1,5 @@
 /dev/pts       /dev/pts        none    rw,bind         0       0
 tmpfs          /dev/shm        tmpfs   defaults        0       0
+# Mount a large scratch space for the build, so we don't use up
+# space on the LVM snapshot of the chroot itself.
 /home/buildd/build-trees       /build  none    rw,bind 0       0
diff --git a/etc/profile-templates/default/linux/fstab 
b/etc/profile-templates/default/linux/fstab
index 97dc4ec..79cd722 100644
--- a/etc/profile-templates/default/linux/fstab
+++ b/etc/profile-templates/default/linux/fstab
@@ -1,3 +1,4 @@
-/dev            /dev            none    rw,rbind        0       0
+/dev            /dev            none    rw,bind         0       0
 /home          /home           none    rw,bind         0       0
 /tmp           /tmp            none    rw,bind         0       0
+/dev/pts       /dev/pts        none    rw,bind         0       0
diff --git a/etc/profile-templates/desktop/linux/fstab 
b/etc/profile-templates/desktop/linux/fstab
index 9463df1..f9a29a4 100644
--- a/etc/profile-templates/desktop/linux/fstab
+++ b/etc/profile-templates/desktop/linux/fstab
@@ -1,6 +1,16 @@
-/dev            /dev            none    rw,rbind        0       0
+/dev            /dev            none    rw,bind         0       0
+/dev/pts       /dev/pts        none    rw,bind         0       0
 /home          /home           none    rw,bind         0       0
 /tmp           /tmp            none    rw,bind         0       0
 
 # If you use gdm3, uncomment this line to allow Xauth to work
 #/var/run/gdm3 /var/run/gdm3   none    rw,bind         0       0
+
+# More generally, it may be desirable to have access to /run,
+# especially if you wish to run additional services in the chroot.
+# However, note that this may potentially cause undesirable behaviour
+# on upgrades, such as killing services on the host.
+#/run          /run            none    rw,bind         0       0
+#/run/lock     /run/lock       none    rw,bind         0       0
+#/dev/shm      /dev/shm        none    rw,bind         0       0
+#/run/shm      /run/shm        none    rw,bind         0       0

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: signature.asc
Description: Digital signature

Reply via email to