puppetlabs/facter — pull request #266 by daniel-pittman (2012-07-20 15:13:24+00:00)
Title: misc exec to ruby transformations

This transforms various uses of exec into plain Ruby code.

That includes a bunch of places where `exec cat /proc/...` is used to work around the briefly reintroduced kernel bug (thanks, RHEL) that caused select on proc files to behave super-badly. (Which the Ruby runtime used, showing the problem.)

Instead of papering over the problem by doing something slower and more awful in some-but-not-all places in our code that touch /proc, if fixing this matters we should just detect if we are on a problem system at load time and patch File.read, File.open, and friends directly to handle this secretly and internally. Everyone wins then, especially people who don't know how it works.