<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote">2015-01-15 23:22 GMT+09:00 Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>>:</div><div class="gmail_quote">> What do /proc/self/cgroup and /var/log/upstart/cgmanager.log now show?</div><div class="gmail_quote"><br></div><div class="gmail_quote">/proc/self/cgroup shows this:</div><div class="gmail_quote">root@myhost:~# cat /proc/self/cgroup</div><div class="gmail_quote">4:name=systemd:/</div><div class="gmail_quote">3:freezer,devices,name=container:/12042</div><div class="gmail_quote">2:cpuacct,cpu,cpuset,name=fairsched:/12042</div><div class="gmail_quote">1:blkio,name=beancounter:/12042</div><div class="gmail_quote">root@myhost:~#</div><div class="gmail_quote"><br></div><div class="gmail_quote">And /var/log/upstart/cgmanager.log is this:</div><div class="gmail_quote">root@myhost:~# tail -n 50 /var/log/upstart/cgmanager.log</div><div class="gmail_quote">Mounted fairsched onto /run/cgmanager/fs/none,name=fairsched</div><div class="gmail_quote">Mounted beancounter onto /run/cgmanager/fs/none,name=beancounter</div><div class="gmail_quote">found 4 controllers</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.systemd</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.container</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.fairsched</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.beancounter</div><div class="gmail_quote">Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">cgmanager: Failed mounting /run/cgmanager/fs/none,name=container: Operation not permitted</div><div class="gmail_quote">cgmanager: Failed mounting cgroups</div><div class="gmail_quote">cgmanager: Failed to set up cgroup mounts</div><div class="gmail_quote">Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">Mounted container onto /run/cgmanager/fs/none,name=container</div><div class="gmail_quote">Mounted fairsched onto /run/cgmanager/fs/none,name=fairsched</div><div class="gmail_quote">Mounted beancounter onto /run/cgmanager/fs/none,name=beancounter</div><div class="gmail_quote">found 4 controllers</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.systemd</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.container</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.fairsched</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.beancounter</div><div class="gmail_quote">Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">cgmanager: Failed mounting /run/cgmanager/fs/none,name=container: Operation not permitted</div><div class="gmail_quote">cgmanager: Failed mounting cgroups</div><div class="gmail_quote">cgmanager: Failed to set up cgroup mounts</div><div class="gmail_quote">Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">Mounted container onto /run/cgmanager/fs/none,name=container</div><div class="gmail_quote">Mounted fairsched onto /run/cgmanager/fs/none,name=fairsched</div><div class="gmail_quote">Mounted beancounter onto /run/cgmanager/fs/none,name=beancounter</div><div class="gmail_quote">found 4 controllers</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.systemd</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.container</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.fairsched</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.beancounter</div><div class="gmail_quote">Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">cgmanager: Failed mounting /run/cgmanager/fs/none,name=container: Operation not permitted</div><div class="gmail_quote">cgmanager: Failed mounting cgroups</div><div class="gmail_quote">cgmanager: Failed to set up cgroup mounts</div><div class="gmail_quote">Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">Mounted container onto /run/cgmanager/fs/none,name=container</div><div class="gmail_quote">Mounted fairsched onto /run/cgmanager/fs/none,name=fairsched</div><div class="gmail_quote">Mounted beancounter onto /run/cgmanager/fs/none,name=beancounter</div><div class="gmail_quote">found 4 controllers</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.systemd</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.container</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.fairsched</div><div class="gmail_quote">buf is /run/cgmanager/agents/cgm-release-agent.beancounter</div><div class="gmail_quote">Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">cgmanager: Failed mounting /run/cgmanager/fs/none,name=container: Operation not permitted</div><div class="gmail_quote">cgmanager: Failed mounting cgroups</div><div class="gmail_quote">cgmanager: Failed to set up cgroup mounts</div><div class="gmail_quote">root@myhost:~#</div><div class="gmail_quote"><br></div><div class="gmail_quote">Sorry for bothering you..</div><div class="gmail_quote"><br></div><div class="gmail_quote">> Quoting Smart Goldman (<a href="mailto:ytlec2014@gmail.com">ytlec2014@gmail.com</a>):</div><div class="gmail_quote">> > > Sorry, I did a bad cut-paste.  Drop the "env" in front of</div><div class="gmail_quote">> > cgm_extra_mounts.</div><div class="gmail_quote">> > > Make sure that</div><div class="gmail_quote">> > ></div><div class="gmail_quote">> > > cgm_extra_mounts="-m</div><div class="gmail_quote">> > name=systemd,name=container,name=fairsched,name=beancounter"</div><div class="gmail_quote">> > ></div><div class="gmail_quote">> > > is all one line.</div><div class="gmail_quote">> ></div><div class="gmail_quote">> > Thank you. The log "failed: invalid request" by reboot has been removed!</div><div class="gmail_quote">> > But instead, now these 2 errors are written in /var/log/auth.log by login.</div><div class="gmail_quote">> ></div><div class="gmail_quote">> > Jan 15 13:38:57 myhost systemd-logind[440]: Failed to create cgroup</div><div class="gmail_quote">> > name=systemd:/user/0.user: No such file or directory</div><div class="gmail_quote">> > Jan 15 13:38:57 myhost sshd[894]: pam_systemd(sshd:session): Failed to</div><div class="gmail_quote">> > create session: No such file or directory</div><div class="gmail_quote">> ></div><div class="gmail_quote">> > Hmm... Why these errors come again?</div><div class="gmail_quote">> ></div><div class="gmail_quote">> > Here are logs of reboot and login:</div><div class="gmail_quote">> > Jan 15 13:36:08 myhost sshd[1097]: Accepted password for root from</div><div class="gmail_quote">> > 119.105.136.26 port 54477 ssh2</div><div class="gmail_quote">> > Jan 15 13:36:08 myhost sshd[1097]: pam_unix(sshd:session): session opened</div><div class="gmail_quote">> > for user root by (uid=0)</div><div class="gmail_quote">> > Jan 15 13:36:08 myhost systemd-logind[442]: Removed session c3.</div><div class="gmail_quote">> > Jan 15 13:36:08 myhost systemd-logind[442]: New session c4 of user root.</div><div class="gmail_quote">> > Jan 15 13:37:59 myhost systemd-logind[440]: New seat seat0.</div><div class="gmail_quote">> > Jan 15 13:38:00 myhost sshd[495]: Server listening on 0.0.0.0 port 22.</div><div class="gmail_quote">> > Jan 15 13:38:00 myhost sshd[495]: Server listening on :: port 22.</div><div class="gmail_quote">> > Jan 15 13:38:57 myhost sshd[894]: Accepted password for root from</div><div class="gmail_quote">> > 119.105.136.26 port 54519 ssh2</div><div class="gmail_quote">> > Jan 15 13:38:57 myhost sshd[894]: pam_unix(sshd:session): session opened</div><div class="gmail_quote">> > for user root by (uid=0)</div><div class="gmail_quote">> > Jan 15 13:38:57 myhost systemd-logind[440]: Failed to create cgroup</div><div class="gmail_quote">> > name=systemd:/user/0.user: No such file or directory</div><div class="gmail_quote">> > Jan 15 13:38:57 myhost sshd[894]: pam_systemd(sshd:session): Failed to</div><div class="gmail_quote">> > create session: No such file or directory</div><div class="gmail_quote">> > root@myhost:~#</div><div class="gmail_quote">> ></div><div class="gmail_quote">> > 2015-01-15 22:33 GMT+09:00 Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>>:</div><div class="gmail_quote">> ></div><div class="gmail_quote">> > > Quoting Smart Goldman (<a href="mailto:ytlec2014@gmail.com">ytlec2014@gmail.com</a>):</div><div class="gmail_quote">> > > > 2015-01-15 5:12 GMT+09:00 Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>>:</div><div class="gmail_quote">> > > > > Quoting Smart Goldman (<a href="mailto:ytlec2014@gmail.com">ytlec2014@gmail.com</a>):</div><div class="gmail_quote">> > > > > > 2015-01-15 0:11 GMT+09:00 Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>>:</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > > cgmanager is an lxc project, so no worries.</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > Okay. and thank you for swift response.</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > > A few things - first, running cgroup-bin alongside cgmanager is</div><div class="gmail_quote">> > > > > > probably a bad idea.</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > Oh really? It is better to remove either one?</div><div class="gmail_quote">> > > > > > Another following 2 errors were output before installing these 2</div><div class="gmail_quote">> > > things.</div><div class="gmail_quote">> > > > > > sshd[4603]: pam_systemd(sshd:session): Failed to create session: No</div><div class="gmail_quote">> > > such</div><div class="gmail_quote">> > > > > > file or directory</div><div class="gmail_quote">> > > > > > systemd-logind[2957]: Failed to create cgroup</div><div class="gmail_quote">> > > > name=systemd:/user/0.user: No</div><div class="gmail_quote">> > > > > > such file or directory</div><div class="gmail_quote">> > > > ></div><div class="gmail_quote">> > > > > 0.user?  This is logging in as root?</div><div class="gmail_quote">> > > ></div><div class="gmail_quote">> > > > Yes. This log was recorded by logging in with root.</div><div class="gmail_quote">> > > > If I am right, it was output as 1000.user when I logged in with normal</div><div class="gmail_quote">> > > user.</div><div class="gmail_quote">> > > ></div><div class="gmail_quote">> > > > > > After executing 'apt-get -y install cgroup-bin cgmanager-utils',</div><div class="gmail_quote">> > > above 2</div><div class="gmail_quote">> > > > > > errors were removed.</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > > Second, on 14.04 after install cgmanager</div><div class="gmail_quote">> > > > > > > you unfortunately need to 'sudo restart systemd-logind', then</div><div class="gmail_quote">> > > > > > > log out and log back in (or just ssh localhost) to get a new</div><div class="gmail_quote">> > > > > > > cgroup.  After that you should be able to create unprivileged</div><div class="gmail_quote">> > > > containers.</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > Now I tried 'sudo restart systemd-logind' and systemd-logind</div><div class="gmail_quote">> > > restarted.</div><div class="gmail_quote">> > > > > > After that I logged out, log back and execute 'reboot'.</div><div class="gmail_quote">> > > > > > However error log of cgmanager is still written on /var/log/auth.log.</div><div class="gmail_quote">> > > > ></div><div class="gmail_quote">> > > > > Create the file /etc/default/cgmanager containing the text:</div><div class="gmail_quote">> > > > ></div><div class="gmail_quote">> > > > > cgmanager_opts="--debug"</div><div class="gmail_quote">> > > > ></div><div class="gmail_quote">> > > > > Restart cgmanager (sudo stop cgmanager; sudo start cgmanager) and then</div><div class="gmail_quote">> > > > > login, and look at /var/log/upstart/cgmanager.log</div><div class="gmail_quote">> > > ></div><div class="gmail_quote">> > > > Here's /var/log/upstart/cgmanager.log after restarting and logging in the</div><div class="gmail_quote">> > > > ubuntu with root. I found there is something like error</div><div class="gmail_quote">> > > > "cgmanager:get_pid_cgroup_main: Could not determine the requestor</div><div class="gmail_quote">> > > cgroup".</div><div class="gmail_quote">> > > ></div><div class="gmail_quote">> > > > root@myhost:~# tail -f /var/log/upstart/cgmanager.log</div><div class="gmail_quote">> > > > UPSTART_JOB=cgmanager</div><div class="gmail_quote">> > > > TERM=linux</div><div class="gmail_quote">> > > > PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin</div><div class="gmail_quote">> > > > cgmanager_opts=--debug</div><div class="gmail_quote">> > > > PWD=/</div><div class="gmail_quote">> > > > cgm_extra_mounts=-m</div><div class="gmail_quote">> > > > name=systemd,name=container,name=fairsched,name=beancounter</div><div class="gmail_quote">> > > > Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">> > > > found 1 controllers</div><div class="gmail_quote">> > > > buf is /run/cgmanager/agents/cgm-release-agent.systemd</div><div class="gmail_quote">> > > > Mounted systemd onto /run/cgmanager/fs/none,name=systemd</div><div class="gmail_quote">> > > > Connection from private client</div><div class="gmail_quote">> > > > GetPidCgroup: Client fd is: 6 (pid=442, uid=0, gid=0)</div><div class="gmail_quote">> > > > cgmanager:get_pid_cgroup_main: Could not determine the requestor cgroup</div><div class="gmail_quote">> > > > Disconnected from private client</div><div class="gmail_quote">> > > > Connection from private client</div><div class="gmail_quote">> > > > Create: Client fd is: 6 (pid=442, uid=0, gid=0)</div><div class="gmail_quote">> > > > Created /run/cgmanager/fs/none,name=systemd/user/0.user/c2.session for</div><div class="gmail_quote">> > > 442</div><div class="gmail_quote">> > > > (0:0)</div><div class="gmail_quote">> > > > cgmanager_create: returning 0; existed is -1</div><div class="gmail_quote">> > > > Connection from private client</div><div class="gmail_quote">> > > > Disconnected from private client</div><div class="gmail_quote">> > > > MovePid: Client fd is: 7 (pid=442, uid=0, gid=0)</div><div class="gmail_quote">> > > > 963 moved to systemd:user/0.user/c2.session by 442's request</div><div class="gmail_quote">> > > > Connection from private client</div><div class="gmail_quote">> > > > Disconnected from private client</div><div class="gmail_quote">> > > > Chown: Client fd is: 6 (pid=442, uid=0, gid=0)</div><div class="gmail_quote">> > > > Chown: Client fd is: 6 (pid=442, uid=0, gid=0)</div><div class="gmail_quote">> > > > Connection from private client</div><div class="gmail_quote">> > > > Disconnected from private client</div><div class="gmail_quote">> > > > Chown: Client fd is: 7 (pid=442, uid=0, gid=0)</div><div class="gmail_quote">> > > > Chown: Client fd is: 7 (pid=442, uid=0, gid=0)</div><div class="gmail_quote">> > > > Disconnected from private client</div><div class="gmail_quote">> > > ></div><div class="gmail_quote">> > > > > > This error message is written even if I log out before reboot is</div><div class="gmail_quote">> > > > executed</div><div class="gmail_quote">> > > > > > or I execute reboot via control panel which is outside of ubuntu</div><div class="gmail_quote">> > > system.</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > > The message may be ignorable - the real question is, when you</div><div class="gmail_quote">> > > > > > > login, do you get a custom cgroup?  What does /proc/self/cgroup</div><div class="gmail_quote">> > > > > > > show?</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > I am sorry. How can I know whether I got a custom cgroup?</div><div class="gmail_quote">> > > > > > Here is the contents of my /proc/self/cgroup.</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > root@myhost:~# cat /proc/self/cgroup</div><div class="gmail_quote">> > > > > > 4:name=systemd:/user/1000.user/c1.session</div><div class="gmail_quote">> > > > > > 3:freezer,devices,name=container:/12042</div><div class="gmail_quote">> > > > > > 2:cpuacct,cpu,cpuset,name=fairsched:/12042</div><div class="gmail_quote">> > > > > > 1:blkio,name=beancounter:/12042</div><div class="gmail_quote">> > > > > > root@myhost:~#</div><div class="gmail_quote">> > > > > ></div><div class="gmail_quote">> > > > > > I appreciate your help and I apologize for troubling you.</div><div class="gmail_quote">> > > > ></div><div class="gmail_quote">> > > > > The /12042 is weird.  It looks like something libcgroup may have</div><div class="gmail_quote">> > > > > done for you.</div><div class="gmail_quote">> > > > ></div><div class="gmail_quote">> > > > > You may be able to work around this by adding the line:</div><div class="gmail_quote">> > > > ></div><div class="gmail_quote">> > > > > env cgm_extra_mounts="-m</div><div class="gmail_quote">> > > > name=systemd,name=container,name=fairsched,name=beancounter"</div><div class="gmail_quote">> > > > ></div><div class="gmail_quote">> > > > > to /etc/default/cgmanager</div><div class="gmail_quote">> > > ></div><div class="gmail_quote">> > > > I added that line to /etc/default/cgmanager.</div><div class="gmail_quote">> > > > But the log "failed: invalid request" is still written.</div><div class="gmail_quote">> > > ></div><div class="gmail_quote">> > > > Here's my current /etc/default/cgmanager:</div><div class="gmail_quote">> > > > root@myhost:~# cat /etc/default/cgmanager</div><div class="gmail_quote">> > > > cgmanager_opts="--debug"</div><div class="gmail_quote">> > > > env cgm_extra_mounts="-m</div><div class="gmail_quote">> > > > name=systemd,name=container,name=fairsched,name=beancounter"</div><div class="gmail_quote">> > ></div><div class="gmail_quote">> > > Sorry, I did a bad cut-paste.  Drop the "env" in front of cgm_extra_mounts.</div><div class="gmail_quote">> > > Make sure that</div><div class="gmail_quote">> > ></div><div class="gmail_quote">> > > cgm_extra_mounts="-m</div><div class="gmail_quote">> > > name=systemd,name=container,name=fairsched,name=beancounter"</div><div class="gmail_quote">> > ></div><div class="gmail_quote">> > > is all one line.</div><div class="gmail_quote">> > > _______________________________________________</div><div class="gmail_quote">> > > lxc-users mailing list</div><div class="gmail_quote">> > > <a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a></div><div class="gmail_quote">> > > <a href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></div><div class="gmail_quote">> > ></div><div class="gmail_quote">> </div><div class="gmail_quote">> > _______________________________________________</div><div class="gmail_quote">> > lxc-users mailing list</div><div class="gmail_quote">> > <a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a></div><div class="gmail_quote">> > <a href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></div><div class="gmail_quote">> </div><div class="gmail_quote">> _______________________________________________</div><div class="gmail_quote">> lxc-users mailing list</div><div class="gmail_quote">> <a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a></div><div class="gmail_quote">> <a href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></div><div><br></div></div></div></div>