[patch 1/4][resend] fuse-procfs: proxy proc files

Daniel Lezcano daniel.lezcano at free.fr
Mon Sep 28 08:47:51 PDT 2009

Krzysztof Taraszka wrote:
> Thank you Daniel.
> I have a little problem with fuse and containers. Do I have to add the fuse
> device to the container?
> When I tried to mount procfs I received:
> container2:/# ./procfs -odirect_io /proc/meminfo
> fuse: device not found, try 'modprobe fuse' first
> The fuse module was loaded on host. What I did wrong? I am asking because I
> am working around user space scripts for managing lxc (written in bash,
> init.d script, few lxc-create-* scripts based on distro, etc) and I would
> like to add this development future to this scripts.
> Right now I have few nice and good looking userspace scripts.
> Would be great If I may do the deb and rpm package with lxc user scripts and
> lxc-tools or add my scripts to lxc-tools tree.
Let's see :)

> More about that in this week in the different thread. Hope you will give me
> the direction guys.

I think the command line is not right. Fuse uses at the /proc directory 
when initializating, so that have to be done in two steps:

Can you try:

lxc-execute -n foo /bin/bash

(from the shell in the container):
procfs -o direct_io /tmp/<tmpdir>
mount --bind /tmp/<tmpdir> /proc
echo 268435456 > /cgroup/foo/memory.memsw.limit_in_bytes
echo 268435456 > /cgroup/foo/memory.limit_in_bytes

* before exiting the container:
umount /proc
fusermount -u /tmp/<tmpfile>

If you do 'ls /proc', you should see everything expect the /proc/sys 
If you do 'cat /proc/meminfo', you should see:
MemTotal: 262144 kB
MemFree: 250684 kB
SwapTotal: 262144 kB
SwapFree: 0 kB

More information about the Containers mailing list