2009/8/24 Daniel Lezcano <span dir="ltr"><<a href="mailto:dlezcano@fr.ibm.com">dlezcano@fr.ibm.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">Krzysztof Taraszka wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/8/24 Daniel Lezcano <<a href="mailto:daniel.lezcano@free.fr" target="_blank">daniel.lezcano@free.fr</a>><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Krzysztof Taraszka wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/8/23 Daniel Lezcano <<a href="mailto:daniel.lezcano@free.fr" target="_blank">daniel.lezcano@free.fr</a>><br>
<br>
(...)<br>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
With the lxc tools I did:<br>
<br>
      lxc-execute -n foo /bin/bash<br>
      echo 268435456 > /cgroup/foo/memory.limit_in_bytes<br>
      mount --bind /cgroup/foo/memory.meminfo /proc/meminfo<br>
      for i in $(seq 1 100); do sleep 3600 & done<br>
<br>
<br>
</blockquote>
<br>
(...)<br>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
:)<br>
<br>
<br>
<br>
<br>
</blockquote>
hmmm... I think that access to the cgroup inside container is very risk<br>
because I am able to manage for example memory resources (what if I am not<br>
the host owner and... I can give me via non-secure mounted /cgroup (inside<br>
container) all available memory resources...).<br>
I think that the /proc/meminfo should be pass to the container in the<br>
other<br>
way, but this is the topic for the other thread.<br>
<br>
<br>
</blockquote>
It is not a problem, I did it in this way because it's easy to test but in<br>
a real use case, the memory limit is setup by the lxc configuration file and<br>
the cgroup directory will be no longer accessible from the container.<br>
<br>
</blockquote>
<br>
<br>
So.. how there will be another method (more secure) for giving /proc/meminfo<br>
with limits to the container, right?<br>
</blockquote>
<br></div></div>
Same method. The lxc tools can be configured with a fstab to mount more mount points, furthermore if memory.meminfo is available I will add the code to mount it automatically to /proc/meminfo in the lxc tools.<br>
</blockquote></div><br><br>Hmm... setup_fs() from lxc_init.c or another way?<br><br>-- <br>Krzysztof Taraszka<br>