Issue #19097 has been updated by Lee Lowder.

Status changed from Unreviewed to Accepted

I can see how this can also cause problems when you have related services like 
foo and foo-workers running.

It also looks like the getpid function is the same in 3.0.2 / current Master 
branch

Not sure offhand of a good fix though.
----------------------------------------
Bug #19097: Puppet Provider Service Type does ugly detection of PIDs
https://projects.puppetlabs.com/issues/19097#change-82661

Author: Geoff Meakin
Status: Accepted
Priority: Low
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.7.20
Keywords: mcollective status puppet service down up inconsistent
Branch: 


Deep in the heart of puppetland, the "status" function whose purpose is to 
check whether or not a service is running, relies on this getpid function:

/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/redhat.rb

  def getpid 
    .... snip ....
    regex = Regexp.new(@resource[:pattern])
    ... snip ...
    IO.popen(ps) { |table|
      table.each { |line|
        if regex.match(line)
          ary = line.sub(/^\s+/, '').split(/\s+/)
          return ary[1]


In other words, Check if any part of the process table matches the servicename 
by regexing it.
I have been tripped up by this numerous times, because for example, I am 
tailing a process "tail -f my.puppet.monitoring.script.log", and this function 
tells the system that puppet is running.

Obviously this is the last-chance saloon way of finding whether a service is 
"alive" after trying first the hasstatus-related /sbin/service methods, 
however, even as a last-chance saloon it is highly likely to fail.




-- 
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://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to