# File lib/facter/util/virtual.rb, line 161
  def self.lxc?
    path = Pathname.new('/proc/1/cgroup')
    return false unless path.readable?
    begin
      in_lxc = path.readlines.any? {|l| l.split(":")[2].to_s.include? '/lxc' }
    rescue Errno::EPERM => exc
      # If we get "operation not permitted" here, it probably means we are
      # running OpenVZ. We are not running LXC anyway, so...
      return false
    end
    return true if in_lxc
    return false
  end