<div dir="ltr">The lxc-ls command fetches its information here;<div><a href="https://github.com/lxc/lxc/blob/master/src/lxc/lxccontainer.c#L3224">https://github.com/lxc/lxc/blob/master/src/lxc/lxccontainer.c#L3224</a><br></div>
<div><br></div><div>It seems to do some checks against `/proc/net/unix`, however I'm not entire clear on the logic.</div><div><br></div><div>I suspect that lxc-start actually maintains some sort of state file somewhere which defines if the container is started or not, rather than checking if the lxc-start pid exists, but a core dev will need to clarify this.</div>
<div><br></div><div>You could possibly do a manual check to see if the pid exists in the mean time.</div><div><br></div><div>Hope this helps a bit</div><div><br></div><div>Cal</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sat, Jan 11, 2014 at 7:17 AM, Andy Johnson <span dir="ltr"><<a href="mailto:johnsonzjo@gmail.com" target="_blank">johnsonzjo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I start a busybox container by:<br>
lxc-start -n busyboxCTNew<br>
<br>
from another terminal I get the pid of the parent process of the container by :<br>
psaux | grep lxc-start<br>
<br>
root 1994 0.0 0.0 26092 1304 pts/1 S+ 09:04 0:00<br>
lxc-start -n busyboxCTNew<br>
<br>
I run:<br>
kill -9 1994<br>
<br>
(I know that containers should be stopped with lxc-stop for graceful shutdown).<br>
<br>
>From the container, I see:<br>
can't open /dev/tty1: Input/output error<br>
Killed<br>
<br>
And the containers shell does not show anymore (we return to the host shell)<br>
<br>
However, if I run<br>
lxc-ls --active<br>
I get:<br>
busyboxCTNew<br>
<br>
<br>
Why does lxc-ls --active still shows the busyboxCTNew container as<br>
active ? (I get the same result also when trying 10 minutes after<br>
running the "kill -9" command).<br>
<br>
<br>
Regards,<br>
Andy<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</blockquote></div><br></div>