Bug #2032
uptime fact hangs reading /proc/uptime
| Status: | Closed | Start: | 02/26/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 100% |
||
| Category: | library | |||
| Target version: | 1.5.5 | |||
| Keywords: | Branch: | |||
| Votes: | 0 |
Description
“/sbin/service puppet start” hangs at:
Feb 26 21:31:52 HOSTNAME puppetd[24685]: Reopening log files
Feb 26 21:31:52 HOSTNAME puppetd[24685]: Starting Puppet client version 0.24.7
Feb 26 21:31:52 HOSTNAME puppet: puppetd startup succeeded
facter version 1.5.4 (from .tgz)
It looks to be coming from inside uptime.rb, and specificaly from reading /proc/uptime. This machine is RedHat ES4 Update 6. Strace info is below:
strace -e ‘!nanosleep,close,sigprocmask’ -Ff service puppet start
[pid 3509] open(“/usr/lib/ruby/site_ruby/1.8/facter/uptime.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 3509] fstat64(6, {st_mode=S_IFREG|0644, st_size=548, …}) = 0 [pid 3509] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb708c000 [pid 3509] read(6, “require \‘facter/util/uptime\’\n\nFa”…, 4096) = 548 [pid 3509] read(6, “”, 4096) = 0 [pid 3509] munmap(0xb708c000, 4096) = 0 [pid 3509] stat64(“/usr/lib/ruby/site_ruby/1.8/facter/util/uptime.rb”, {st_mode=S_IFREG|0644, st_size=1025, …}) = 0 [pid 3509] open(“/usr/lib/ruby/site_ruby/1.8/facter/util/uptime.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 3509] stat64(“/usr/lib/ruby/site_ruby/1.8/facter/util/uptime.rb”, {st_mode=S_IFREG|0644, st_size=1025, …}) = 0 [pid 3509] open(“/usr/lib/ruby/site_ruby/1.8/facter/util/uptime.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 3509] open(“/usr/lib/ruby/site_ruby/1.8/facter/util/uptime.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 3509] open(“/usr/lib/ruby/site_ruby/1.8/facter/util/uptime.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 3509] open(“/usr/lib/ruby/site_ruby/1.8/facter/util/uptime.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 3509] fstat64(6, {st_mode=S_IFREG|0644, st_size=1025, …}) = 0 [pid 3509] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb708c000 [pid 3509] read(6, “# A module to gather uptime fact”…, 4096) = 1025 [pid 3509] read(6, “”, 4096) = 0 [pid 3509] munmap(0xb708c000, 4096) = 0 [pid 3509] stat64(“/proc/uptime”, {st_mode=S_IFREG|0444, st_size=0, …}) = 0 [pid 3509] open(“/proc/uptime”, O_RDONLY|O_LARGEFILE) = 6 [pid 3509] select(7, [6], [], [], {0, 0}) = 0 (Timeout) [pid 3509] gettimeofday({1235685917, 888942}, NULL) = 0 [pid 3509] gettimeofday({1235685917, 889039}, NULL) = 0 [pid 3509] select(7, [3 6], [], [], NULL) = 1 (in [3]) [pid 3509] read(3, “.”, 256) = 1 [pid 3509] gettimeofday({1235685917, 889587}, NULL) = 0 [pid 3509] gettimeofday({1235685917, 889676}, NULL) = 0 [pid 3509] gettimeofday({1235685917, 889837}, NULL) = 0 [pid 3509] gettimeofday({1235685917, 890025}, NULL) = 0 [pid 3509] gettimeofday({1235685917, 890068}, NULL) = 0 [pid 3509] select(7, [3 6], [], [], {11, 252007}) = 0 (Timeout) [pid 3509] gettimeofday({1235685929, 143389}, NULL) = 0 [pid 3509] select(7, [3 6], [], [], {0, 0}) = 0 (Timeout) [pid 3509] select(7, [6], [], [], {0, 0}) = 0 (Timeout)
the process then loops around the selects/gettimeofday.
Tried setting the File.open() to be NONBLOCK, but no luck. “service puppet once” runs just fine, as does “facter” with no args.
Associated revisions
Revision 86b01bf61b143e03647f5983cbc99beae8744704
Fixed #2032 – file.open hanging on /proc/uptime on some platform
History
Updated by James Turnbull over 1 year ago
- Project changed from Puppet to Facter
Updated by James Turnbull over 1 year ago
- Category set to library
- Status changed from Unreviewed to Ready for Testing
- Assigned to set to James Turnbull
- Target version set to 1.6.0
Okay this seems to be a known issue with Ruby on some Linux 2.6 kernels trying to read /proc files. I’ve pushed a fix to the -dev mailing list which is an ugly, ugly hack.
Updated by James Turnbull over 1 year ago
- Status changed from Ready for Testing to Closed
- % Done changed from 0 to 100
Applied in changeset commit:“86b01bf61b143e03647f5983cbc99beae8744704”.
Updated by James Turnbull over 1 year ago
- Target version changed from 1.6.0 to 1.5.5
Updated by Sharif Nassar about 1 year ago
As pointed out by Luke, the ‘r’ needs to be closed. Otherwise:
$ pstree 4934 puppetd—-638*[cat]
$ ps 18512
PID TTY STAT TIME COMMAND
18512 ? Z 0:00 [cat]
Updated by James Turnbull about 1 year ago
This was fixed in commit:“9bc174faffcdb412e07e2dde1686cdec9a4d638c” in branch master.