lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Missing system directories in chroot


From: Greg Chicares
Subject: Re: [lmi] Missing system directories in chroot
Date: Sat, 8 Oct 2016 18:32:17 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.3.0

On 2016-09-16 00:41, Greg Chicares wrote:
[...mounting /dev/pts and /proc in chroot...]
> I see that it's mounted in the base OS:
>   $mount |grep devpts
>   devpts on /dev/pts type devpts 
> (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
>   devpts on /srv/chroot/chrome/dev/pts type devpts 
> (rw,relatime,mode=600,ptmxmode=000)
> (which would disappear if I rebooted).
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Now I've added that to the chroot instructions, with due regard to
the 'nosuid' and 'noexec' options:

http://git.savannah.gnu.org/cgit/lmi.git/commit/README.schroot?id=28d831a259f5a656f10f9cf14c9467f3b2835af4
+# This being a "plain" schroot, mount essential directories:
+mount -t devpts -o rw,nosuid,noexec,relatime,mode=600 devpts /dev/pts
+mount -t proc -o rw,nosuid,nodev,noexec,relatime proc /proc
+
+# If the chroot is to be permanent, consider adding those mounts to /etc/fstab 
.

but I'm wondering about the last line quoted above. We're hoping to create
a chroot this way on a corporate server, which might be rebooted at any time,
so it's important that these mounts persist across reboots. But what's the
best way to ensure that--is /etc/fstab the best answer, as debian suggests:

https://wiki.debian.org/chroot#Default_Configurations
| Generally the file /etc/fstab might look like this:
| # grep chroot /etc/fstab
| /dev /srv/chroot/wheezy/dev auto bind 0 0
| /dev/pts /srv/chroot/wheezy/dev/pts auto bind 0 0
| /proc /srv/chroot/wheezy/proc auto bind 0 0

or is that likely to be problematic with a RHEL system running systemd?
I would guess that this method is robust, because any distribution is
probably going to mount /proc early, before it even processes /etc/fstab,
so that the extra mounts in fstab won't affect the base system.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]