[Pkg-puppet-devel] Bug#515660: Bug#515660: Bug#515660: service type stops working with Debian's insserv

Nigel Kersten nigel at explanatorygap.net
Thu Aug 6 19:28:03 UTC 2009


2009/8/6 martin f krafft <madduck at debian.org>:
> also sprach Micah Anderson <micah at riseup.net> [2009.08.06.1659 +0200]:
>> I'm not sure it is a good idea to create a class called 'cron' with a
>> service 'cron' and package 'cron' and not get into namesapce problems
>> with the cron native-type.
>
> It works on all machines except those using insserv. I hope puppet
> doesn't have namespace collisions between services, classes,
> packages, and types.
>
>> If I were to take a guess, I would guess that your problem is that on
>> every run puppet is doing this state change (setting cron/enable from
>> false to true). Is that what you are experiencing?
>
> Exactly that. I get mail from logcheck every 30 minutes with this
> line:
>
>  (//Node[default]/cron/Service[cron]/enable) enable changed 'false' to 'true'

I see the problem.

    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
    end

This is how it works out whether it is enabled or not, and it's not
matching when insserv is installed as the output differs.

The output looks like:

insserv: remove service /etc/init.d/../rc1.d/S17cron

when insserv is installed, but when it isn't, it looks like

 /etc/rc1.d/S17cron

There must be a better way to do this...





More information about the Pkg-puppet-devel mailing list