Issue #4995 has been updated by Krzysztof Wilczynski.

Krzysztof Wilczynski wrote:
> Jonas Genannt wrote:
> > I think you can check if lxc-* binaries and /cgroup is mounted, than the 
> > system is an LXC "master" that can run containers
> > 
> > Inside an LXC container it's a little bit harder. Checking for cgroups at 
> > "/proc/self/status" tells us only, that the process is inside an cgroup not 
> > inside an LXC container.


Apologies for the delay. Too much to do at day job ...

My take on this: 
[lxc.rb](https://raw.github.com/kwilczynski/facter-facts/master/lxc.rb); in the 
repository: [facter-facts](https://github.com/kwilczynski/facter-facts).

I tested it using multiple versions of LXC and "liblxc", plus few different 
versions of "libvirt" (why do they change so much between releases?!) and I do 
hope that everything works as it says on the tin :-)

What needs doing: consolidating it under the "virtual" fact which was also done 
and I need to give it just a little bit more attention, and as usual I need to 
write tests for it ... :)

Hope that helps ... and feedback always welcome! :)

KW
----------------------------------------
Feature #4995: LXC Container support
https://projects.puppetlabs.com/issues/4995

Author: Jonas Genannt
Status: Investigating
Priority: Low
Assignee: Krzysztof Wilczynski
Category: library
Target version: 
Keywords: virtual,lxc
Branch: 
Affected Facter version: 


The virtual fact for facter should support lxc containers.

For more information about lxc: http://lxc.sourceforge.net/

We can detect an running lxc master system, if /cgroup is mounted on the system.




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to