[Lxc-users] uptodate Ubuntu Lucid guests

C Anthony Risinger anthony at extof.me
Mon Sep 6 22:44:56 UTC 2010


On Mon, Sep 6, 2010 at 4:08 PM, Papp Tamás <tompos at martos.bme.hu> wrote:
> Papp Tamás wrote, On 2010. 09. 05. 0:58:
>> What is the right grep pattern so it matches for lxc? In other words,
>> how can I be sure, I'm in an lxc container?
>>
>
> Does anybody have any idea about this? I just need something in the
> containaer which doesn't exist in a real machine.

i the past (before migrating to google apps) i did:

# cat /proc/1/cgroup
1:blkio,net_cls,freezer,devices,memory,cpuacct,cpu,ns,cpuset:/

if you see anything after the ":/" (the cgroup name), you're in a
cgroup; if you see nothing, your on the host.

worked fine for me, but i don't know if it's 100% reliable.

C Anthony




More information about the lxc-users mailing list