[Lxc-users] Gathering information about containers - from inside and from outside
Daniel Lezcano
daniel.lezcano at free.fr
Sun Jul 18 21:13:18 UTC 2010
On 07/18/2010 04:36 PM, Clemens Perz wrote:
> On 07/18/2010 02:39 PM, Daniel Lezcano wrote:
>
>> On 07/18/2010 11:48 AM, Clemens Perz wrote:
>>
>>> Hi,
>>>
>>> So doing a while on /var/lib/lxc as a starting point, run lxc-info on
>>> each, find out which one is running, examine its cgroup and so on.
>>>
>> You should look for the abstract socket "@/var/lib/lxc/<name>/command"
>> too. This socket exists when the container is running. The container can
>> run without a previous creation, hence you won't find it in
>> /var/lib/lxc. These containers are called "volatile containers".
>>
> Cool, found them in /proc/net/unix, thats good. Is there a way to read
> this path - /var/lib/lxc - from somewhere? Just thinking if some distro
> might want to change it at compiletime and then the script sucks :)
>
The scripts should rely on pkg-config:
In your case it is:
pkg-config --variable=localstatedir lxc
should give you "/var/lib/lxc/".
You can look at /usr/share/pkgconfig/lxc for the list of variables.
>>> that the macvlan module is not used.
>>>
>> Do you mean the refcount is 0 ? or the module is not visible ?
>>
> Sorry, yes, the refcount stays 0. I was looking for host-side
> information about the container and its network interfaces too. Maybe
> this is a way to make things more visible in case you need to track
> problems. And of course give me a chance to understand it :D
>
You are right, the refcount is 0. Weird because the refcount prevents
the unloading of the module.
At the first glance that seems to not hurt the system to unload the
macvlan module while it is in use,
it seems to gracefully fall into "network is unreachable". But it should
be interesting to ask netdev@ why.
> BTW, giving the option lxc.network.ipv4 in the config, does that do
> anything inside the container? Can it be propagated?
This ip address will be assigned to the container's network.
> Or can I just omit
> it, when I use the containers dist tools to setup the interface?
>
Right. If your system boots and set an IP address, this config option
is useless.
It is mainly used for application container but it can be used for
system containers too, if you want lxc to handle the network
configuration (partially supported).
Thanks
-- Daniel
More information about the lxc-users
mailing list