Please review pull request #529: Show matched processes for services in debug. opened by (joehillen)
Description:
I was having a terrible time debugging why nrpe would not restart correctly on Ubuntu 10.04.
It turns out that puppet was sometimes matching the wrong process number, but I had to add a debug line to find this out.
Here is an example of someone else having this issue, though I did not find this to be a permanent fix:
http://redscreen.wordpress.com/2011/07/22/restarting-nagios-from-puppet-on-debian/
I see this debug message being useful for other situations, such as testing to make sure a process' regex matches correctly.
- Opened: Mon Feb 27 21:17:38 UTC 2012
- Based on: puppetlabs:master (b01fc5f44150ae710a2039daf7762531bf837ec6)
- Requested merge: joehillen:master (088b4a4501dddf3cfb012136eb74d17349ac8e35)
Diff follows:
diff --git a/lib/puppet/provider/service/base.rb b/lib/puppet/provider/service/base.rb
index 2d8f559..cb415f0 100755
--- a/lib/puppet/provider/service/base.rb
+++ b/lib/puppet/provider/service/base.rb
@@ -26,6 +26,7 @@ def getpid
IO.popen(ps) { |table|
table.each_line { |line|
if regex.match(line)
+ self.debug "Process matched: #{line}"
ary = line.sub(/^\s+/, '').split(/\s+/)
return ary[1]
end
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" 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-dev?hl=en.
