Issue #2044 has been updated by jamtur01.

Target version changed from 1.6.0 to 1.5.5


----------------------------------------
Bug #2044: problems with virtual.rb on RHEL4
http://projects.reductivelabs.com/issues/2044

Author: wbx
Status: Closed
Priority: Normal
Assigned to: 
Category: library
Target version: 1.5.5
Complexity: Trivial
Keywords: virtual xen proc capabilities puppetd hangs after trigger


Hi,

I have a problem with facter 1.5.2 under Red Hat 4 ES/AS (Xen guests). When I 
trigger a configuration run via
puppetrun, puppetd hangs after reading /proc/xen/capabilities. It does not 
happen on RHEL5 or real hardware.

Problem is similar to this bug report: 
http://fossplanet.com/sysutils.puppet.devel/thread-1849839-hangs/

Solution is similar, too:
diff -Nur facter-1.5.2.orig/lib/facter/virtual.rb 
facter-1.5.2/lib/facter/virtual.rb
--- facter-1.5.2.orig/lib/facter/virtual.rb     2008-09-09 05:00:03.000000000 
+0200
+++ facter-1.5.2/lib/facter/virtual.rb  2009-03-03 12:55:43.000000000 +0100
@@ -1,4 +1,5 @@
 Facter.add("virtual") do
+  require 'thread'
   confine :kernel => %w{Linux FreeBSD OpenBSD}
   
   ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
@@ -11,12 +12,14 @@
       result = "openvz"
     end
 
-    if FileTest.exists?("/proc/xen/capabilities") && 
FileTest.readable?("/proc/xen/capabilities")
-      txt = File.read("/proc/xen/capabilities")
-      if txt =~ /control_d/i
-        result = "xen0"
-      else
-        result = "xenu" 
+    Thread::exclusive do
+      if FileTest.exists?("/proc/xen/capabilities") && 
FileTest.readable?("/proc/xen/capabilities")
+        txt = File.read("/proc/xen/capabilities")
+        if txt =~ /control_d/i
+          result = "xen0"
+        else
+          result = "xenu" 
+        end
       end
     end

Have fun
 Waldemar


-- 
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://reductivelabs.com/redmine/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