<div dir="ltr">Hello,<div><br></div><div>Recently after upgrading lxc on Ubuntu 14.04.3 LTS, I noticed that it included the libpam-cgm package. I started to see some weird problems with cgroups and ownerships when trying to start an unprivileged container in the cases when the user running the containers is not the same as the user who logged in to the machine (for eg: ssh, change user and then start container fails). I believe this may have to do with the recent changes to libpam-cgm, lxcfs and cgfs as I didn't have any trouble before. After changing the user we used to unset the XDG envs and run the cgm commands to setup cgroups which stopped to work recently.</div><div><br></div><div><b>lxc-start failure trace</b> (full stack trace attached):</div><div><div>      lxc-start 1454029959.193 ERROR    lxc_utils - utils.c:setproctitle:1455 - Invalid argument - setting cmdline failed</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:handle_cgroup_settings:2091 - Permission denied - failed to set memory.use_hierarchy to 1; continuing</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:lxc_cgroupfs_create:849 - Could not set clone_children to 1 for cpuset hierarchy in parent cgroup.</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/perf_event/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/memory/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/hugetlb/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/freezer/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/devices/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/cpuset/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/cpuacct/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/cpu/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_cgfs - cgfs.c:cgroup_rmdir:166 - cgroup_rmdir: failed to open /run/lxcfs/controllers/blkio/user/test/0</div><div>      lxc-start 1454029959.581 ERROR    lxc_start - start.c:lxc_spawn:970 - failed creating cgroups</div><div>      lxc-start 1454029959.581 ERROR    lxc_start - start.c:__lxc_start:1213 - failed to spawn 'test'</div><div>      lxc-start 1454029965.093 ERROR    lxc_start_ui - lxc_start.c:main:344 - The container failed to start.</div><div><br></div></div><div><br></div><div><b>Steps to reproduce:</b></div><div>* Upgrade LXC: $ sudo apt-get upgrade cgmanager libcgmanager0 lxc libcap2 libseccomp2 ruby-dev lxc-dev</div><div>* Add the management of all controllers to the pam module. Replace the freezer in /etc/pam.d/common-session with all controllers:</div><div><div>session<span class="Apple-tab-span" style="white-space:pre">        </span>optional<span class="Apple-tab-span" style="white-space:pre">    </span>pam_cgm.so -c freezer,perf_event,memory,cpu,cpuacct,cpuset,blkio,hugetlb,devices</div></div><div>* Add a test user : $ sudo useradd test -m</div><div>* Setup lxc configuration file for test user:</div><div>$ sudo su - test</div><div>$ mkdir -p ~/.config/lxc</div><div>$ cat > ~/.config/lxc/default.conf</div><div><div>lxc.include = /etc/lxc/default.conf</div><div># you may have to change to your subuids/subgids</div><div>lxc.id_map = u 0 231072 65536</div><div>lxc.id_map = g 0 231072 65536</div></div><div>* Create container: $ lxc-create -n test -t download -- -d ubuntu -r trusty -a amd64</div><div>* Run the container: $ lxc-start -n test -d -l debug -o container.log</div><div><br></div><div><b>System info:</b></div><div><div>$ uname -r</div><div>3.13.0-76-generic</div><div><div><br></div><div>$ dpkg -l | grep lxc</div><div>ii  liblxc1                          1.1.5-0ubuntu5~ubuntu14.04.1~ppa1   amd64        Linux Containers userspace tools (library)</div><div>ii  lxc                              1.1.5-0ubuntu5~ubuntu14.04.1~ppa1   amd64        Linux Containers userspace tools</div><div>ii  lxc-dev                          1.1.5-0ubuntu5~ubuntu14.04.1~ppa1   amd64        Linux Containers userspace tools (development)</div><div>ii  lxc-templates                    1.1.5-0ubuntu5~ubuntu14.04.1~ppa1   amd64        Linux Containers userspace tools (templates)</div><div>ii  lxcfs                            0.17-0ubuntu2~ubuntu14.04.1~ppa1    amd64        FUSE based filesystem for LXC</div><div>ii  python3-lxc                      1.1.5-0ubuntu5~ubuntu14.04.1~ppa1   amd64        Linux Containers userspace tools (Python 3.x bindings)</div></div></div><div><br></div><div><div>$ dpkg -l | grep cgm</div><div>ii  cgmanager                        0.39-2ubuntu5~ubuntu14.04.1~ppa1    amd64        Central cgroup manager daemon</div><div>ii  libcgmanager0:amd64              0.39-2ubuntu5~ubuntu14.04.1~ppa1    amd64        Central cgroup manager daemon (client library)</div><div>ii  libpam-cgm                       0.39-2ubuntu5~ubuntu14.04.1~ppa1    amd64        Central cgroup manager daemon (PAM module)</div></div><div><br></div><div>I would appreciate some help on this as I have been trying to figure out the problem for the last few days now.</div></div>