On Mon, Apr 4, 2016 at 10:02 AM, Paul Schroeder <paul.schroeder@nimbix.net> wrote:


On Fri, Apr 1, 2016 at 8:21 PM, Joe Zeff <joe@zeff.us> wrote:
On 04/01/2016 08:05 AM, Paul Schroeder wrote:
I tried both.  Neither solution seemed to keep the mount from happening.

Have you considered using umount to remove the unwanted mount in /etc/rc.d/rc.local?  It's not exactly elegant, but it should do the trick.

Yea.  That won't really work:

# umount /dev
umount: /dev: target is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

 
It would appear that the LXC config option for the container, lxc.automount, determines whether or not LXC decides to mount devtmpfs on /dev.  When lxc.automount = 1, it is obviously on and always does this.  After digging through the LXC code, if the option is not specified, LXC autodetects whether or not systemd is used inside the container.  If it is detected, LXC automatically turns automount on.  (I wish this had been documented somewhere.)  So to stop LXC from mounting /dev, one has to explicitly set lxc.automount = 0..

However, this causes problems inside the container, causing it to freeze on boot.  It would appear that systemd within my CentOS container is still trying to mount /dev when it can't.  I believe that I have all of the udev services masked properly, so this must be coming from somewhere else within systemd.  Any further ideas out there?

$ sudo lxc-start -n c7
Failed to mount devtmpfs at /dev: Permission denied
Failed to mount cgroup at /sys/fs/cgroup/systemd: Permission denied
[!!!!!!] Failed to mount API filesystems, freezing.

Thanks!  Paul...