[Lxc-users] what's the difference in lxc-attach

Joerg Gollnick code4lxc+list at wurzelbenutzer.de
Mon Jul 18 19:22:28 UTC 2011


Hello Serge,
I think that the main point is the initial setup of the cgroup (directory) 
structure.

systemd 
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup 
(rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-
agent,clone_children,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup 
(rw,nosuid,nodev,noexec,relatime,cpuset,clone_children)
cgroup on /sys/fs/cgroup/ns type cgroup (rw,nosuid,nodev,noexec,relatime,ns)
cgroup on /sys/fs/cgroup/cpu type cgroup 
(rw,nosuid,nodev,noexec,relatime,cpu,clone_children)
cgroup on /sys/fs/cgroup/cpuacct type cgroup 
(rw,nosuid,nodev,noexec,relatime,cpuacct,clone_children)
cgroup on /sys/fs/cgroup/memory type cgroup 
(rw,nosuid,nodev,noexec,relatime,memory,clone_children)
cgroup on /sys/fs/cgroup/devices type cgroup 
(rw,nosuid,nodev,noexec,relatime,devices,clone_children)
cgroup on /sys/fs/cgroup/freezer type cgroup 
(rw,nosuid,nodev,noexec,relatime,freezer,clone_children)
cgroup on /sys/fs/cgroup/net_cls type cgroup 
(rw,nosuid,nodev,noexec,relatime,net_cls,clone_children)
cgroup on /sys/fs/cgroup/blkio type cgroup 
(rw,nosuid,nodev,noexec,relatime,blkio,clone_children)

Above is on a Archlinux machine with systemd, initramfs is build without any 
systemd support.  

Btw systemd has detect LXC with $container=lxc in the TODO file.

On the other hand a feature for lxc to set lxc.init=/bin/systemd would be 
nice. 

Best regards Joerg

On Monday 18 July 2011 19:02:54 Serge E. Hallyn wrote:
> (sorry, just realized postfix has been messing up my email, hope this
> comes through ok)
> 
> Quoting Ramez Hanna (rhanna at informatiq.org):
> > in f15 systemd whenever a user starts a process it looks like this
> > ├ user
> > │ ├ root
> > │ │ └ 86
> > │ │   ├ 24814 -bash
> > │ │   ├ 24848 top
> > │ │   └ 31324 login -- root
> > │ └ rhanna
> > │   ├ 56
> > │   │ ├  1002 pam: gdm-password
> > │   │ ├  1047 /usr/bin/enlightenment
> > │   │ ├  1058 dbus-launch --sh-syntax --exit-with-session
> > │   │ ├  1059 /bin/dbus-daemon --fork --print-pid 5 --print-address 7
> > --sess...
> > 
> > so i would expect lxc to create it's cgroup under the user (root in this
> > case) instead
> > while it currebtly shows it like this
> > boss is the name of the container
> > ├ 24811 [kworker/1:0]
> > ├ boss
> > │ ├ 8914 init [3]
> > │ ├ 9135 /usr/sbin/cron
> > │ ├ 9146 /usr/sbin/sshd
> > 
> > now I am not trying to use systemd-nspawn to replace lxc or anything, I
> > am just using it to debug if i had problems in my container rootfs
> > and well if nspawn doesn't screw up my host then it is doing something
> > better
> 
> Sorry I've not had time to read this thread through sufficiently, but the
> above, at first glance, is telling.  Does fedora's initramfs set up the
> first part of the cgroup hierarchy?  My guess is that's the problem and
> so systemd is expecting /user to be already set up.  So to support
> systemd, we may need to either have a init wrapper to do some of the
> initramfs cruft, or have lxc do it.  Yuck to both.  Yuck to use of
> initramfs for anything other than loading needed kernel modules :)
> 
> -serge
> 
> 
> ----------------------------------------------------------------------------
> -- Storage Efficiency Calculator
> This modeling tool is based on patent-pending intellectual property that
> has been used successfully in hundreds of IBM storage optimization engage-
> ments, worldwide.  Store less, Store more with what you own, Move data to
> the right place. Try It Now!
> http://www.accelacomm.com/jaw/sfnl/114/51427378/
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users




More information about the lxc-users mailing list