Ben Hughes wrote: > I've got this fact, trying to use it with the munin module from DavidS > to work out which drives to graph. Fairly run of the mill, but when ever > I add this in to my facter folder. Puppet barfs with a Timeout::Error > > [r...@foo-vm:~]# invoke-rc.d puppet start > Starting puppet configuration management tool > info: Loading fact whatraid > info: Loading fact localdisks > /usr/lib/ruby/1.8/timeout.rb:60: execution expired (Timeout::Error) > from /var/lib/puppet/lib/facter/localdisks.rb:20:in `open' > from /var/lib/puppet/lib/facter/localdisks.rb:20 > from /usr/lib/ruby/1.8/facter/util/fact.rb:38:in `instance_eval' > from /usr/lib/ruby/1.8/facter/util/fact.rb:38:in `add' > > > The fact (yeah it's ugly...): > > Facter.add("localdisks") do > > disks = [ ] > File.open( "/proc/mounts" , "r" ) do |f| > f.each do |line| > foo = line.chomp!.split("\s") > matchey = foo[0].match(/^\/dev\/([a-z0-9\/]+)[0-9]/) > disks.push(matchey[1]) unless matchey.nil? > end > end > > setcode do > disks.uniq.join(',') > end > end
Seeing /proc/mounts jumps out at me. I have a simple fact that I added as a plugin and causes a similar timeout. In my case, the code which reads /proc/mounts is in read_mounts in puppet/util/selinux.rb. So whenever I have selinux enabled (on a system with libselinux-ruby), I get this timeout and the plugin retrieval fails. It's quite strange, as /proc/mounts is successfully read many times during the course of a puppetd run, both before and after the plugin syncing. Yet it always fails at this same point. For anyone curious, this was already filed as: http://projects.reductivelabs.com/issues/1963 -- Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The greatest gift you can give another is the purity of your attention. -- Richard Moss, M.D.
pgpUyy6Gatc9Z.pgp
Description: PGP signature