I just tried running lxc-attach with linux-2.6.38. I got the same error as with linux-3.0 -- Function not implemented - failed to set namespace 'pid'. <div><br></div><div>Here's the exact sequence of steps that I followed:<div>
<br></div><div>Compiled linux-2.6.38.2 with the corresponding setns patches (<a href="http://lxc.sourceforge.net/patches/linux/2.6.38/2.6.38.2-lxc1/">http://lxc.sourceforge.net/patches/linux/2.6.38/2.6.38.2-lxc1/</a>).</div>
<div><br></div><div>Rebooted into 2.6.38.2</div><div>$ uname -a</div><div>Linux nf-build2 2.6.38.2-lxc-0.7.4-with-setns #1 SMP Thu Sep 8 08:42:40 PDT 2011 x86_64 GNU/Linux</div><div><br></div><div>Compiled lxc-0.7.4:</div>
<div>$ git checkout lxc-0.7.4</div><div>$ ./configure; make; sudo make install</div><div><br></div><div>Created a container:</div><div><div># lxc-execute -n foo -f /etc/mn/host.conf -- /bin/bash </div><div>root@mnhost:~# </div>
</div><div><br></div><div>In a separate terminal, tried running lxc-attach:</div><div><div># lxc-attach -n foo -- /bin/bash </div><div>lxc-attach: Function not implemented - failed to set namespace 'pid'</div><div>
lxc-attach: failed to enter the namespace</div></div><div><br></div><div>Even in linux-2.6.38.2, lxc-attach is failing at the point where it calls setns. Am I doing something wrong here?</div><div><br></div><div>By the way, I'm using Ubuntu 8.04, if that makes any difference.</div>
<div><br></div><div>Thanks,</div><div>Nikhil<br>
<br><br><div class="gmail_quote">On Thu, Sep 8, 2011 at 8:23 AM, Nikhil Handigol <span dir="ltr"><<a href="mailto:nikhil.handigol@gmail.com">nikhil.handigol@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanks Daniel!<div><br></div><div>The linux-3.0 patches don't seem to be working for me unfortunately. </div><div><br></div><div>I compiled lxc-0.7.5 with the patched linux-3.0. After starting a container "foo" via lxc-execute,I ran the following command:</div>
<div class="im">
<div>$ lxc-attach -n foo -- /bin/bash</div><div><br></div><div>When I run lxc-attach, I get the following error:</div></div><div><span style="font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">lxc-attach: Function not implemented - failed to set namespace 'pid'<div class="im">
<br>
lxc-attach: failed to enter the namespace</div></span></div><div><br></div><div>Upon more probing into the errno, I found:</div><div><span style="font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">errno = 38</span></div>

<div><span style="font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">strerror says: Function not implemented</span><span style="font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)"><div>

<span style="display:block;float:left;color:rgb(136, 136, 136)">  </span></div></span></div><div><br></div><div>The required ns files do seem to be present in /proc/<pid>/ns:</div><div><span style="font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">$ ls /proc/28559/ns/<br>

ipc mnt net pid user uts</span></div><div><br></div><div>I also double-checked that all the setns patches were properly applied to the kernel:</div><div><div>$ quilt top</div><div>0016-ns-proc-Enable-setns-for-support-for-the-pid-namespa.patch</div>

</div><div><br></div><div>I'd appreciate any help in fixing this error.</div><div><br></div><div>Thanks,</div><div>Nikhil<font color="#888888"><br>
<br><br></font><div class="gmail_quote"><div class="im">On Wed, Sep 7, 2011 at 6:55 AM, Matteo Bernardini <span dir="ltr"><<a href="mailto:matteo.bernardini@gmail.com" target="_blank">matteo.bernardini@gmail.com</a>></span> wrote:<br>
</div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>> <a href="http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/" target="_blank">http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/</a><br>
<br>
</div>I've done a quick try of the patches with linux-3.0.4 with lxc-0.7.5,<br>
slackware64-13.37 and my existing containers and I'm able to turn them<br>
off easily with<br>
<br>
lxc-attach -n mycontainer -- /sbin/halt<br>
<br>
\o/<br>
<br>
I'll test them more, but in the meantime thanks Daniel!<br>
<font color="#888888"><br>
Matteo<br>
</font><div><div></div><div><br>
------------------------------------------------------------------------------<br>
Using storage to extend the benefits of virtualization and iSCSI<br>
Virtualization increases hardware utilization and delivers a new level of<br>
agility. Learn what those decisions are and how to modernize your storage<br>
and backup environments for virtualization.<br>
<a href="http://www.accelacomm.com/jaw/sfnl/114/51434361/" target="_blank">http://www.accelacomm.com/jaw/sfnl/114/51434361/</a><br>
_______________________________________________<br>
Lxc-users mailing list<br>
<a href="mailto:Lxc-users@lists.sourceforge.net" target="_blank">Lxc-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/lxc-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/lxc-users</a><br>
</div></div></blockquote></div></div></div><br></div>
</blockquote></div><br></div></div>