Hi Christian,

On 12/11/17 4:17 PM, Christian Brauner wrote:

What is the container's config file? liblxc itself does not know what
drbd devices are and cannot create such containers. So I expect your
container's config file to contain a line like:

lxc.rootfs = /data1/<container-name>/rootfs


Here is a sample config file:

lxc.network.type = veth
lxc.network.link = br5
lxc.network.flags = up
lxc.network.hwaddr = 00:16:66:bd:77:7b
lxc.network.ipv4 = 192.168.142.xxx/26
lxc.network.ipv4.gateway = 192.168.142.yyy
lxc.network.type = veth
lxc.network.link = br4
lxc.network.flags = up
lxc.network.hwaddr = 00:16:49:2f:f3:ae
lxc.network.ipv4 = 10.111.111.xxx/24
lxc.rootfs = /data2/lxc/lxc01/rootfs
lxc.rootfs.backend = dir

# Common configuration
lxc.include = /usr/share/lxc/config/debian.common.conf

# Container specific configuration
lxc.mount = /data2/lxc/lxc01/fstab
lxc.tty = 4
lxc.utsname = lxc01
lxc.arch = amd64
lxc.start.auto = 1
lxc.group = auto

The fstab file is empty.

without a storage type prefix and without lxc.rootfs.backend (for old
liblxc versions) set. In this case liblxc will use the dir storage
driver. So liblxc itself should never try to unmount anything on the
host on shutdown especially not /data1. The only interesting thing
liblxc does when the dir storage driver is used is to give itself a bind
mount for the root filesystem in the container's mount namespace. Are
you using any ({post-}stop) hooks?


No hooks, AFAICT. What about all these /proc and /sys filesystems,
tmpfs and all that other stuff? Inside the container (config file
shown above) I see

# cat /proc/self/mounts
/dev/drbd2 / ext4 rw,noatime,stripe=256,data=ordered 0 0
none /dev tmpfs rw,relatime,size=492k,mode=755 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
proc /proc/sys/net proc rw,nosuid,nodev,noexec,relatime 0 0
proc /proc/sys proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/sysrq-trigger proc ro,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
sysfs /sys/devices/virtual/net sysfs rw,relatime 0 0
sysfs /sys/devices/virtual/net sysfs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
devpts /dev/console devpts 
rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=666 0 0
devpts /dev/ptmx devpts rw,relatime,gid=5,mode=620,ptmxmode=666 0 0
devpts /dev/tty1 devpts rw,relatime,gid=5,mode=620,ptmxmode=666 0 0
devpts /dev/tty2 devpts rw,relatime,gid=5,mode=620,ptmxmode=666 0 0
devpts /dev/tty3 devpts rw,relatime,gid=5,mode=620,ptmxmode=666 0 0
devpts /dev/tty4 devpts rw,relatime,gid=5,mode=620,ptmxmode=666 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup 
rw,nosuid,nodev,noexec,relatime,release_agent=/run/cgmanager/agents/cgm-release-agent.systemd,name=systemd
 0 0
cgroup /sys/fs/cgroup/cpuset cgroup 
rw,nosuid,nodev,noexec,relatime,cpuset,release_agent=/run/cgmanager/agents/cgm-release-agent.cpuset,clone_children
 0 0
cgroup /sys/fs/cgroup/blkio cgroup 
rw,nosuid,nodev,noexec,relatime,blkio,release_agent=/run/cgmanager/agents/cgm-release-agent.blkio
 0 0
cgroup /sys/fs/cgroup/memory cgroup 
rw,nosuid,nodev,noexec,relatime,memory,release_agent=/run/cgmanager/agents/cgm-release-agent.memory
 0 0
cgroup /sys/fs/cgroup/devices cgroup 
rw,nosuid,nodev,noexec,relatime,devices,release_agent=/run/cgmanager/agents/cgm-release-agent.devices
 0 0
cgroup /sys/fs/cgroup/freezer cgroup 
rw,nosuid,nodev,noexec,relatime,freezer,release_agent=/run/cgmanager/agents/cgm-release-agent.freezer
 0 0
cgroup /sys/fs/cgroup/perf_event cgroup 
rw,nosuid,nodev,noexec,relatime,perf_event,release_agent=/run/cgmanager/agents/cgm-release-agent.perf_event
 0 0
cgroup /sys/fs/cgroup/pids cgroup 
rw,nosuid,nodev,noexec,relatime,pids,release_agent=/run/cgmanager/agents/cgm-release-agent.pids
 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
tmpfs /run/user/402 tmpfs 
rw,nosuid,nodev,relatime,size=26406048k,mode=700,uid=402,gid=402 0 0
tmpfs /run/user/0 tmpfs rw,nosuid,nodev,relatime,size=26406048k,mode=700 0 0


Does this look OK?


Regards
Harri
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to