Puppet: System Administration Automated

Support

Ticket #1161 (closed defect: fixed)

Opened 7 months ago

Last modified 6 months ago

service provider on Debian doesn't realize a service is disabled

Reported by: rra Assigned to: luke
Priority: normal Milestone:
Component: library Version: 0.24.4
Severity: normal Keywords: debian init
Cc: Triage Stage: Ready for checkin
Attached Patches: None Complexity: Unknown

Description

puppetd in the newly released 0.24.4 repeatedly says:

Wed Mar 26 19:48:03 -0700 2008 //Node[basenode]/ssh/Service[ssh]/enable (notice): enable changed 'true' to 'false'

My guess is that the fix to 1060 broke the logic that determines whether a service's init scripts are already disabled. puppetd probably sees the K* links and thinks that it's still enabled. The logic should change on Debian to considering a service disabled if there are only K* links.

Change History

03/27/08 13:03:14 changed by happymcplaksin

This is a Red Hat bug: https://bugzilla.redhat.com/show_bug.cgi?id=430882

I just asked RH support (again!) when it's going to be fixed.

03/27/08 13:04:58 changed by happymcplaksin

Ha! Sorry. You said Debain :)

04/03/08 12:08:02 changed by jamtur01

  • owner changed from community to luke.
  • stage changed from Unreviewed to Ready for checkin.

Okay this was annoying - and I'll say it again update-rc.d suck arse.

Okay - what Puppet does to check if a service is enabled is:

def enabled?
        output = update "-n", "-f", @resource[:name], "remove"

        # If it's enabled, then it will print output showing removal of
        # links.
        if output =~ /etc\/rc[\dS].d\/S|not installed/
            return :true
        else
            return :false
        end

So essentially it runs:

update-rc.d -n -f servicename remove

If it returns either "not installed" or a list of links to be removed then it's set to "true". Hmmm not sure about that "not installed" but okay. But when a service is disabled using the updated method in #1060 this now returns the K00 links - which results in Puppet thinking the service is enabled when it is in fact ... not.

To fix this I've told Puppet to only assume a service is enabled if the update-rc.d -n -f servicename remove command returns one or more links prefixed with S. If the command returns links with only K prefixes Puppet now knows the service is actually disabled.

Now that logic makes sense to me... can everyone confirm they also feel warm and fuzzy about this?

The fix is in commit [2036d22cfa950ed84957427b98f69c1719b64dd7] in branch 0.24.x

04/03/08 17:31:30 changed by luke

This seems like a reasonable fix to me, but I'm no Debian hero.

Pushed.

04/04/08 02:38:17 changed by rra

Sounds like the right fix to me.

04/08/08 17:31:07 changed by luke

  • status changed from new to closed.
  • resolution set to fixed.

Merged and pushed last week.