[lxc-users] Killing the parent process of a container

Cal Leeming [Simplicity Media Ltd] cal.leeming at simplicitymedialtd.co.uk
Sun Jan 12 19:56:33 UTC 2014


The lxc-ls command fetches its information here;
https://github.com/lxc/lxc/blob/master/src/lxc/lxccontainer.c#L3224

It seems to do some checks against `/proc/net/unix`, however I'm not entire
clear on the logic.

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.

You could possibly do a manual check to see if the pid exists in the mean
time.

Hope this helps a bit

Cal


On Sat, Jan 11, 2014 at 7:17 AM, Andy Johnson <johnsonzjo at gmail.com> wrote:

> Hello,
>
> I start a busybox container by:
> lxc-start -n busyboxCTNew
>
> from another terminal I get the pid of the parent process of the container
> by :
> psaux | grep lxc-start
>
> root      1994  0.0  0.0  26092  1304 pts/1    S+   09:04   0:00
> lxc-start -n busyboxCTNew
>
> I run:
> kill -9 1994
>
> (I know that containers should be stopped with lxc-stop for graceful
> shutdown).
>
> From the container, I see:
> can't open /dev/tty1: Input/output error
> Killed
>
> And the containers shell does not show anymore (we return to the host
> shell)
>
> However, if I run
> lxc-ls --active
> I get:
> busyboxCTNew
>
>
> Why does lxc-ls --active still shows the busyboxCTNew container as
> active ?  (I get the same result also when trying  10 minutes after
> running the "kill -9" command).
>
>
> Regards,
> Andy
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140112/f043a8ae/attachment.html>


More information about the lxc-users mailing list