Hello, Note that Puppet has the following code to test is a service is enabled:
def enabled? # TODO: Replace system call when Puppet::Util::Execution.execute gives us a way # to determine exit status. http://projects.reductivelabs.com/issues/2538 system("/usr/sbin/invoke-rc.d", "--quiet", "--query", @resource[:name], "start") # 104 is the exit status when you query start an enabled service. # 106 is the exit status when the policy layer supplies a fallback action # See x-man-page://invoke-rc.d if [104, 106].include?($CHILD_STATUS.exitstatus) return :true elsif [101, 105].include?($CHILD_STATUS.exitstatus) # 101 is action not allowed, which means we have to do the check manually. # 105 is unknown, which generally means the iniscript does not support query # The debian policy states that the initscript should support methods of query # For those that do not, peform the checks manually # http://www.debian.org/doc/debian-policy/ch-opersys.html if get_start_link_count >= 4 return :true else return :false end else return :false end end I.E: this is more the policy POV. Isn't this sufficient? -- Mathieu Ref: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/service/debian.rb#L31 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org