[Lxc-users] Slow and unexpected umounts after pivot_root

David Serrano dserrano5 at gmail.com
Tue Mar 1 09:57:14 UTC 2011


Hi,

During the containers startup, I'm having an issue when LXC performs
the pivot_root operation and then goes on to umount some directories.
When looked for that on google and saw other people's logs, I found
that this procedure usually performs very quickly, while in my case it
only does about 4 umounts per second.

My setup is a mix of NFS, aufs and loop mounts (I've tested that NFS
doesn't have any impact in this). First, the root filesystem is
mounted from a remote host via NFS. Then, /lib/modules/$(uname -r) is
bind-mounted in their place inside the NFS root. After that, an
overlay image file is loop-mounted and then combined with the NFS root
using aufs. As per the aufs docs, two mount operation are required for
this, due to the bind-mounted kernel modules directory.

## these are done only once
mount -t nfs -o ro host:/dir nfsroot/
mount -o bind /lib/modules/$(uname -r) nfsroot/lib/modules/$(uname -r)

## these are done every time this container is started and undone upon
container exit
mount -o loop ovl00.ext4 /var/lib/lxc/testimg00/ovl00
mount -t aufs -o br:/var/lib/lxc/testimg00/ovl00:nfsroot=ro aufs
/var/lib/lxc/testimg00/root00
mount -t aufs -o br:/var/lib/lxc/testimg00/ovl00/lib/modules/$(uname
-r):nfsroot/lib/modules/$(uname -r)=ro aufs
/var/lib/lxc/testimg00/root00/lib/modules/$(uname -r)

With two containers started, these are the mounted resources as they
appear in /proc/mounts:

--------- 8< ---------
aguila:/var/local/exports/lxc-root /root/testimg01/nfsroot nfs
ro,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.20.64.22,mountvers=3,mountproto=tcp,addr=172.20.64.22
0 0
/dev/disk/by-uuid/f483dd15-192a-4048-952d-775d48d7fdea
/root/testimg01/nfsroot/lib/modules/2.6.32-24-server ext4
rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0

/dev/loop0 /var/lib/lxc/testimg00/ovl00 ext4
rw,relatime,barrier=1,data=ordered 0 0
aufs /var/lib/lxc/testimg00/root00 aufs rw,relatime,si=d476a0c618256dce 0 0
aufs /var/lib/lxc/testimg00/root00/lib/modules/2.6.32-24-server aufs
rw,relatime,si=d476a0c6182551ce 0 0

/dev/loop1 /var/lib/lxc/testimg01/ovl01 ext4
rw,relatime,barrier=1,data=ordered 0 0
aufs /var/lib/lxc/testimg01/root01 aufs rw,relatime,si=d476a0c621c6b3ce 0 0
aufs /var/lib/lxc/testimg01/root01/lib/modules/2.6.32-24-server aufs
rw,relatime,si=d476a0c621c6bdce 0 0
--------- 8< ---------

This setup works as expected but I can see a couple of unexpected
messages in the log of the second container (testimg01). This is the
log of the first one. Notice how long it takes to umount all the stuff
after the pivot_root:

--------- 8< ---------
      lxc-start 1298972537.545 DEBUG    lxc_conf - allocated pty
'/dev/pts/1' (4/5)
      lxc-start 1298972537.545 DEBUG    lxc_conf - allocated pty
'/dev/pts/2' (6/7)
      lxc-start 1298972537.545 DEBUG    lxc_conf - allocated pty
'/dev/pts/3' (8/9)
      lxc-start 1298972537.545 DEBUG    lxc_conf - allocated pty
'/dev/pts/4' (10/11)
      lxc-start 1298972537.545 INFO     lxc_conf - tty's configured
      lxc-start 1298972537.545 DEBUG    lxc_console - using
'/tmp/lxc-testimg00-console.log' as console
      lxc-start 1298972537.545 DEBUG    lxc_start - sigchild handler set
      lxc-start 1298972537.545 INFO     lxc_start - 'testimg00' is initialized
      lxc-start 1298972537.547 DEBUG    lxc_conf - instanciated veth
'vethuCOhiH/vethbhhLlC', index is '62'
      lxc-start 1298972537.573 DEBUG    lxc_cgroup - using cgroup
mounted at '/cgroup'
      lxc-start 1298972537.573 DEBUG    lxc_cgroup - cgroup flags is 0x1
      lxc-start 1298972537.573 WARN     lxc_cgroup - using deprecated ns_cgroup
      lxc-start 1298972537.573 DEBUG    lxc_cgroup - '/cgroup/19236'
renamed to '/cgroup/testimg00'
      lxc-start 1298972537.653 DEBUG    lxc_conf - move 'br0' to '19236'
      lxc-start 1298972537.653 INFO     lxc_conf - 'testimg00'
hostname has been setup
      lxc-start 1298972537.654 DEBUG    lxc_conf - mac address
'54:52:00:00:00:00' on 'eth1' has been setup
      lxc-start 1298972537.655 DEBUG    lxc_conf - 'eth1' has been setup
      lxc-start 1298972537.655 INFO     lxc_conf - network has been setup
      lxc-start 1298972537.655 DEBUG    lxc_conf - mounted
'/var/lib/lxc/testimg00/root00' on '/usr/local/lib/lxc/rootfs'
      lxc-start 1298972537.655 DEBUG    lxc_conf - mounted 'proc' on
'/usr/local/lib/lxc/rootfs/proc', type 'proc'
      lxc-start 1298972537.655 DEBUG    lxc_conf - mounted 'sys' on
'/usr/local/lib/lxc/rootfs/sys', type 'sysfs'
      lxc-start 1298972537.656 DEBUG    lxc_conf - mounted 'devpts' on
'/usr/local/lib/lxc/rootfs/dev/pts', type 'devpts'
      lxc-start 1298972537.656 DEBUG    lxc_conf - mounted 'varlock'
on '/usr/local/lib/lxc/rootfs/var/lock', type 'tmpfs'
      lxc-start 1298972537.656 DEBUG    lxc_conf - mounted 'tmp' on
'/usr/local/lib/lxc/rootfs/tmp', type 'tmpfs'
      lxc-start 1298972537.656 INFO     lxc_conf - mount points have been setup
      lxc-start 1298972537.657 DEBUG    lxc_cgroup - using cgroup
mounted at '/cgroup'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.deny' set to 'a'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 1:3 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 1:5 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 4:0 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 4:1 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 5:0 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 5:1 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 1:8 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 1:9 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 5:2 rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 136:* rwm'
      lxc-start 1298972537.657 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 254:0 rm'
      lxc-start 1298972537.657 INFO     lxc_conf - cgroup has been setup
      lxc-start 1298972537.657 INFO     lxc_conf - console has been setup
      lxc-start 1298972537.657 INFO     lxc_conf - 4 tty(s) has been setup
      lxc-start 1298972537.657 DEBUG    lxc_conf - mountpoint for old
rootfs is '/usr/local/lib/lxc/rootfs/.pivot'
      lxc-start 1298972537.657 DEBUG    lxc_conf - pivot_root syscall
to '/usr/local/lib/lxc/rootfs' successful
      lxc-start 1298972538.633 DEBUG    lxc_conf - umounted '/.pivot/dev/pts'
      lxc-start 1298972538.833 DEBUG    lxc_conf - umounted '/.pivot/dev/shm'
      lxc-start 1298972539.193 DEBUG    lxc_conf - umounted
'/.pivot/sys/fs/fuse/connections'
      lxc-start 1298972539.393 DEBUG    lxc_conf - umounted
'/.pivot/sys/kernel/debug'
      lxc-start 1298972539.593 DEBUG    lxc_conf - umounted
'/.pivot/sys/kernel/security'
      lxc-start 1298972539.963 DEBUG    lxc_conf - umounted
'/.pivot/proc/fs/nfsd'
      lxc-start 1298972540.163 DEBUG    lxc_conf - umounted '/.pivot/var/run'
      lxc-start 1298972540.303 DEBUG    lxc_conf - umounted '/.pivot/var/lock'
      lxc-start 1298972540.503 DEBUG    lxc_conf - umounted
'/.pivot/lib/init/rw'
      lxc-start 1298972540.703 DEBUG    lxc_conf - umounted '/.pivot/cgroup'
      lxc-start 1298972540.903 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/nfs/rpc_pipefs'
      lxc-start 1298972541.263 DEBUG    lxc_conf - umounted
'/.pivot/root/testimg01/nfsroot/lib/modules/2.6.32-24-server'
      lxc-start 1298972541.463 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg00/ovl00'
      lxc-start 1298972541.843 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg00/root00/lib/modules/2.6.32-24-server'
      lxc-start 1298972542.203 DEBUG    lxc_conf - umounted '/.pivot/dev'
      lxc-start 1298972542.403 DEBUG    lxc_conf - umounted '/.pivot/sys'
      lxc-start 1298972542.603 DEBUG    lxc_conf - umounted '/.pivot/proc'
      lxc-start 1298972542.803 DEBUG    lxc_conf - umounted
'/.pivot/root/testimg01/nfsroot'
      lxc-start 1298972543.003 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg00/root00'
      lxc-start 1298972543.213 DEBUG    lxc_conf - umounted '/.pivot'
      lxc-start 1298972543.213 DEBUG    lxc_conf - capabilities has been setup
      lxc-start 1298972543.213 NOTICE   lxc_conf - 'testimg00' is setup.
      lxc-start 1298972543.213 NOTICE   lxc_start - exec'ing '/sbin/init'
      lxc-start 1298972543.215 NOTICE   lxc_start - '/sbin/init'
started with pid '19236'
      lxc-start 1298972543.215 WARN     lxc_console - console input disabled
      lxc-start 1298972543.215 DEBUG    lxc_utmp - Added
'/proc/19236/root/var/run' to inotifywatch
      lxc-start 1298972543.242 DEBUG    lxc_utmp - got inotify event
1073742080 for network
      lxc-start 1298972543.243 DEBUG    lxc_utmp - got inotify event
256 for utmp
      lxc-start 1298972543.246 DEBUG    lxc_utmp - got inotify event
1073742080 for screen
      lxc-start 1298972543.258 DEBUG    lxc_utmp - got inotify event
1073742080 for sshd
      lxc-start 1298972543.260 DEBUG    lxc_utmp - got inotify event
256 for rsyslogd.pid
      lxc-start 1298972543.260 DEBUG    lxc_utmp - got inotify event 2
for rsyslogd.pid
      lxc-start 1298972543.261 DEBUG    lxc_utmp - got inotify event
1073742080 for dbus
      lxc-start 1298972543.261 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972543.262 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972543.263 DEBUG    lxc_utmp - utmp handler - run
level is /2
      lxc-start 1298972543.263 DEBUG    lxc_utmp - Container running
      lxc-start 1298972543.268 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972543.268 DEBUG    lxc_utmp - utmp handler - run
level is /2
      lxc-start 1298972543.269 DEBUG    lxc_utmp - Container running
      lxc-start 1298972543.271 DEBUG    lxc_utmp - got inotify event
1073742080 for qvd
      lxc-start 1298972543.271 DEBUG    lxc_utmp - got inotify event
256 for crond.pid
      lxc-start 1298972543.271 DEBUG    lxc_utmp - got inotify event 2
for crond.pid
      lxc-start 1298972543.271 DEBUG    lxc_utmp - got inotify event 2
for crond.pid
      lxc-start 1298972543.273 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972543.273 DEBUG    lxc_utmp - utmp handler - run
level is /2
      lxc-start 1298972543.273 DEBUG    lxc_utmp - Container running
      lxc-start 1298972543.274 DEBUG    lxc_utmp - got inotify event 2
for crond.pid
      lxc-start 1298972543.274 DEBUG    lxc_utmp - got inotify event 2
for crond.pid
      lxc-start 1298972543.275 DEBUG    lxc_utmp - got inotify event
256 for atd.pid
      lxc-start 1298972543.276 DEBUG    lxc_utmp - got inotify event 2
for atd.pid
      lxc-start 1298972543.276 DEBUG    lxc_utmp - got inotify event
256 for crond.reboot
      lxc-start 1298972543.276 DEBUG    lxc_utmp - got inotify event
256 for sshd.pid
      lxc-start 1298972543.276 DEBUG    lxc_utmp - got inotify event 2
for sshd.pid
      lxc-start 1298972543.468 DEBUG    lxc_utmp - got inotify event
1073742080 for cups
      lxc-start 1298972543.540 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972543.540 DEBUG    lxc_utmp - utmp handler - run
level is /2
      lxc-start 1298972543.540 DEBUG    lxc_utmp - Container running
--------- 8< ---------

And the second:

--------- 8< ---------
      lxc-start 1298972569.065 DEBUG    lxc_conf - allocated pty
'/dev/pts/7' (4/5)
      lxc-start 1298972569.065 DEBUG    lxc_conf - allocated pty
'/dev/pts/8' (6/7)
      lxc-start 1298972569.065 DEBUG    lxc_conf - allocated pty
'/dev/pts/9' (8/9)
      lxc-start 1298972569.065 DEBUG    lxc_conf - allocated pty
'/dev/pts/10' (10/11)
      lxc-start 1298972569.065 INFO     lxc_conf - tty's configured
      lxc-start 1298972569.065 DEBUG    lxc_console - using
'/tmp/lxc-testimg01-console.log' as console
      lxc-start 1298972569.065 DEBUG    lxc_start - sigchild handler set
      lxc-start 1298972569.065 INFO     lxc_start - 'testimg01' is initialized
      lxc-start 1298972569.067 DEBUG    lxc_conf - instanciated veth
'veth1K3r9K/vethtdqORi', index is '65'
      lxc-start 1298972569.093 DEBUG    lxc_cgroup - using cgroup
mounted at '/cgroup'
      lxc-start 1298972569.093 DEBUG    lxc_cgroup - cgroup flags is 0x1
      lxc-start 1298972569.093 WARN     lxc_cgroup - using deprecated ns_cgroup
      lxc-start 1298972569.093 DEBUG    lxc_cgroup - '/cgroup/19446'
renamed to '/cgroup/testimg01'
      lxc-start 1298972569.163 DEBUG    lxc_conf - move 'br0' to '19446'
      lxc-start 1298972569.163 INFO     lxc_conf - 'testimg01'
hostname has been setup
      lxc-start 1298972569.163 DEBUG    lxc_conf - mac address
'54:52:00:00:00:01' on 'eth1' has been setup
      lxc-start 1298972569.164 DEBUG    lxc_conf - 'eth1' has been setup
      lxc-start 1298972569.164 INFO     lxc_conf - network has been setup
      lxc-start 1298972569.164 DEBUG    lxc_conf - mounted
'/var/lib/lxc/testimg01/root01' on '/usr/local/lib/lxc/rootfs'
      lxc-start 1298972569.165 DEBUG    lxc_conf - mounted 'proc' on
'/usr/local/lib/lxc/rootfs/proc', type 'proc'
      lxc-start 1298972569.165 DEBUG    lxc_conf - mounted 'sys' on
'/usr/local/lib/lxc/rootfs/sys', type 'sysfs'
      lxc-start 1298972569.165 DEBUG    lxc_conf - mounted 'devpts' on
'/usr/local/lib/lxc/rootfs/dev/pts', type 'devpts'
      lxc-start 1298972569.165 DEBUG    lxc_conf - mounted 'varlock'
on '/usr/local/lib/lxc/rootfs/var/lock', type 'tmpfs'
      lxc-start 1298972569.165 DEBUG    lxc_conf - mounted 'tmp' on
'/usr/local/lib/lxc/rootfs/tmp', type 'tmpfs'
      lxc-start 1298972569.165 INFO     lxc_conf - mount points have been setup
      lxc-start 1298972569.165 DEBUG    lxc_cgroup - using cgroup
mounted at '/cgroup'
      lxc-start 1298972569.165 DEBUG    lxc_conf - cgroup
'devices.deny' set to 'a'
      lxc-start 1298972569.165 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 1:3 rwm'
      lxc-start 1298972569.165 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 1:5 rwm'
      lxc-start 1298972569.165 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 4:0 rwm'
      lxc-start 1298972569.166 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 4:1 rwm'
      lxc-start 1298972569.166 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 5:0 rwm'
      lxc-start 1298972569.166 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 5:1 rwm'
      lxc-start 1298972569.166 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 1:8 rwm'
      lxc-start 1298972569.166 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 1:9 rwm'
      lxc-start 1298972569.166 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 5:2 rwm'
      lxc-start 1298972569.166 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 136:* rwm'
      lxc-start 1298972569.166 DEBUG    lxc_conf - cgroup
'devices.allow' set to 'c 254:0 rm'
      lxc-start 1298972569.166 INFO     lxc_conf - cgroup has been setup
      lxc-start 1298972569.166 INFO     lxc_conf - console has been setup
      lxc-start 1298972569.166 INFO     lxc_conf - 4 tty(s) has been setup
      lxc-start 1298972569.166 DEBUG    lxc_conf - mountpoint for old
rootfs is '/usr/local/lib/lxc/rootfs/.pivot'
      lxc-start 1298972569.166 DEBUG    lxc_conf - pivot_root syscall
to '/usr/local/lib/lxc/rootfs' successful
      lxc-start 1298972570.523 DEBUG    lxc_conf - umounted '/.pivot/dev/pts'
      lxc-start 1298972570.793 DEBUG    lxc_conf - umounted '/.pivot/dev/shm'
      lxc-start 1298972571.223 DEBUG    lxc_conf - umounted
'/.pivot/sys/fs/fuse/connections'
      lxc-start 1298972571.503 DEBUG    lxc_conf - umounted
'/.pivot/sys/kernel/debug'
      lxc-start 1298972571.753 DEBUG    lxc_conf - umounted
'/.pivot/sys/kernel/security'
      lxc-start 1298972572.333 DEBUG    lxc_conf - umounted
'/.pivot/proc/fs/nfsd'
      lxc-start 1298972572.613 DEBUG    lxc_conf - umounted '/.pivot/var/run'
      lxc-start 1298972572.853 DEBUG    lxc_conf - umounted '/.pivot/var/lock'
      lxc-start 1298972573.133 DEBUG    lxc_conf - umounted
'/.pivot/lib/init/rw'
      lxc-start 1298972573.413 DEBUG    lxc_conf - umounted '/.pivot/cgroup'
      lxc-start 1298972573.693 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/nfs/rpc_pipefs'
      lxc-start 1298972574.213 DEBUG    lxc_conf - umounted
'/.pivot/root/testimg01/nfsroot/lib/modules/2.6.32-24-server'
      lxc-start 1298972574.493 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg00/ovl00'
      lxc-start 1298972574.973 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg00/root00/lib/modules/2.6.32-24-server'
      lxc-start 1298972575.223 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg01/ovl01'
      lxc-start 1298972575.753 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg01/root01/lib/modules/2.6.32-24-server'
      lxc-start 1298972576.233 DEBUG    lxc_conf - umounted '/.pivot/dev'
      lxc-start 1298972576.513 DEBUG    lxc_conf - umounted '/.pivot/sys'
      lxc-start 1298972576.833 DEBUG    lxc_conf - umounted '/.pivot/proc'
      lxc-start 1298972577.113 DEBUG    lxc_conf - umounted
'/.pivot/root/testimg01/nfsroot'
      lxc-start 1298972577.393 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg00/root00'
      lxc-start 1298972577.753 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg01/root01'
      lxc-start 1298972578.033 DEBUG    lxc_conf - umounted '/.pivot'
      lxc-start 1298972578.033 DEBUG    lxc_conf - capabilities has been setup
      lxc-start 1298972578.033 NOTICE   lxc_conf - 'testimg01' is setup.
      lxc-start 1298972578.033 NOTICE   lxc_start - exec'ing '/sbin/init'
      lxc-start 1298972578.034 NOTICE   lxc_start - '/sbin/init'
started with pid '19446'
      lxc-start 1298972578.034 WARN     lxc_console - console input disabled
      lxc-start 1298972578.035 DEBUG    lxc_utmp - Added
'/proc/19446/root/var/run' to inotifywatch
      lxc-start 1298972578.051 DEBUG    lxc_utmp - got inotify event
1073742080 for network
      lxc-start 1298972578.052 DEBUG    lxc_utmp - got inotify event
256 for utmp
      lxc-start 1298972578.055 DEBUG    lxc_utmp - got inotify event
1073742080 for screen
      lxc-start 1298972578.064 DEBUG    lxc_utmp - got inotify event
256 for rsyslogd.pid
      lxc-start 1298972578.064 DEBUG    lxc_utmp - got inotify event 2
for rsyslogd.pid
      lxc-start 1298972578.064 DEBUG    lxc_utmp - got inotify event
1073742080 for sshd
      lxc-start 1298972578.066 DEBUG    lxc_utmp - got inotify event
1073742080 for dbus
      lxc-start 1298972578.067 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972578.067 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972578.067 DEBUG    lxc_utmp - utmp handler - run
level is /2
      lxc-start 1298972578.067 DEBUG    lxc_utmp - Container running
      lxc-start 1298972578.071 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972578.071 DEBUG    lxc_utmp - utmp handler - run
level is /2
      lxc-start 1298972578.071 DEBUG    lxc_utmp - Container running
      lxc-start 1298972578.072 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972578.072 DEBUG    lxc_utmp - utmp handler - run
level is /2
      lxc-start 1298972578.072 DEBUG    lxc_utmp - Container running
      lxc-start 1298972578.074 DEBUG    lxc_utmp - got inotify event
256 for crond.pid
      lxc-start 1298972578.074 DEBUG    lxc_utmp - got inotify event 2
for crond.pid
      lxc-start 1298972578.074 DEBUG    lxc_utmp - got inotify event 2
for crond.pid
      lxc-start 1298972578.075 DEBUG    lxc_utmp - got inotify event 2
for crond.pid
      lxc-start 1298972578.075 DEBUG    lxc_utmp - got inotify event 2
for crond.pid
      lxc-start 1298972578.075 DEBUG    lxc_utmp - got inotify event
1073742080 for qvd
      lxc-start 1298972578.076 DEBUG    lxc_utmp - got inotify event
256 for atd.pid
      lxc-start 1298972578.076 DEBUG    lxc_utmp - got inotify event 2
for atd.pid
      lxc-start 1298972578.076 DEBUG    lxc_utmp - got inotify event
256 for crond.reboot
      lxc-start 1298972578.079 DEBUG    lxc_utmp - got inotify event
256 for sshd.pid
      lxc-start 1298972578.079 DEBUG    lxc_utmp - got inotify event 2
for sshd.pid
      lxc-start 1298972578.242 DEBUG    lxc_utmp - got inotify event
1073742080 for cups
      lxc-start 1298972578.300 DEBUG    lxc_utmp - got inotify event 2 for utmp
      lxc-start 1298972578.300 DEBUG    lxc_utmp - utmp handler - run
level is /2
      lxc-start 1298972578.301 DEBUG    lxc_utmp - Container running

--------- 8< ---------

In this second log, there are two lines that surprise me:

      lxc-start 1298972574.493 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg00/ovl00'
      lxc-start 1298972574.973 DEBUG    lxc_conf - umounted
'/.pivot/var/lib/lxc/testimg00/root00/lib/modules/2.6.32-24-server'

Why has LXC to umount these directories? They belong to another
container so I understand they shouldn't appear here at all. I
detected this when starting the 9th or 10th container and having to
wait for a longer time than usual for it to appear online.

My kernel version is 2.6.32-24-server (x86_64) and this happens with
both LXC 0.7.2 and 0.7.4 (didn't try with 0.7.3). This is the
configuration (the same for both containers):

--------- 8< ---------
## general
lxc.tty = 4
lxc.pivotdir = .pivot
#lxc.arch=x86

## network
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth1
lxc.network.mtu = 1500

## devices
lxc.cgroup.devices.deny = a
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 5:2 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 254:0 rm

## there's some capabilities stuff here but the
## problem still exists if I comment it out
--------- 8< ---------

And this is how I run lxc-start for each container:

lxc-start -f container.conf -n testimg00 -l DEBUG -o /tmp/lxc-testimg00.log \
  -s lxc.utsname=testimg00 \
  -s lxc.console=/tmp/lxc-testimg00-console.log \
  -s lxc.rootfs=/var/lib/lxc/testimg00/root00 \
  -s lxc.mount.entry="proc    /var/lib/lxc/testimg00/root00/proc
proc   defaults  0 0" \
  -s lxc.mount.entry="sys     /var/lib/lxc/testimg00/root00/sys
sysfs  defaults  0 0" \
  -s lxc.mount.entry="devpts  /var/lib/lxc/testimg00/root00/dev/pts
devpts defaults  0 0" \
  -s lxc.mount.entry="varlock /var/lib/lxc/testimg00/root00/var/lock
tmpfs  defaults  0 0" \
  -s lxc.mount.entry="tmp     /var/lib/lxc/testimg00/root00/tmp
tmpfs  mode=1777 0 0" \
  -s lxc.network.hwaddr=54:52:00:00:00:00 \
  -s lxc.network.ipv4=10.1.0.230/24

lxc-start -f container.conf -n testimg01 -l DEBUG -o /tmp/lxc-testimg01.log \
  -s lxc.utsname=testimg01 \
  -s lxc.console=/tmp/lxc-testimg01-console.log \
  -s lxc.rootfs=/var/lib/lxc/testimg01/root01 \
  -s lxc.mount.entry="proc    /var/lib/lxc/testimg01/root01/proc
proc   defaults  0 0" \
  -s lxc.mount.entry="sys     /var/lib/lxc/testimg01/root01/sys
sysfs  defaults  0 0" \
  -s lxc.mount.entry="devpts  /var/lib/lxc/testimg01/root01/dev/pts
devpts defaults  0 0" \
  -s lxc.mount.entry="varlock /var/lib/lxc/testimg01/root01/var/lock
tmpfs  defaults  0 0" \
  -s lxc.mount.entry="tmp     /var/lib/lxc/testimg01/root01/tmp
tmpfs  mode=1777 0 0" \
  -s lxc.network.hwaddr=54:52:00:00:00:01 \
  -s lxc.network.ipv4=10.1.0.231/24

Has anyone experienced something like this? Any clue would be appreciated.


--
David Serrano




More information about the lxc-users mailing list