On Mon, Sep 6, 2010 at 4:08 PM, Papp Tamás <[email protected]> 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 ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ Lxc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lxc-users
