Index: facter-1.5.2/lib/facter/virtual.rb =================================================================== --- facter-1.5.2.orig/lib/facter/virtual.rb +++ facter-1.5.2/lib/facter/virtual.rb @@ -7,7 +7,7 @@ Facter.add("virtual") do setcode do - if FileTest.exists?("/proc/user_beancounters") + if FileTest.exists?("/proc/vz/veinfo") && !FileTest.exists?("/proc/vz/version") result = "openvz" end @@ -45,12 +45,11 @@ Facter.add("virtual") do result = "vmware_server" end - mountexists = system "which mount > /dev/null 2>&1" - if $?.exitstatus == 0 - output = %x{mount} - output.each {|p| - result = "vserver" if p =~ /\/dev\/hdv1/ - } + if FileTest.exists?("/proc/self/status") + txt = File.read("/proc/self/status") + if txt =~ /^(s_context|VxID):[[:blank:]]*[1-9]/ + result = "vserver" + end end if FileTest.directory?('/proc/virtual')