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

Russ Allbery rra at debian.org
Thu Aug 6 19:46:55 UTC 2009


Nigel Kersten <nigel at explanatorygap.net> writes:

> 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...

We *desperately* need a programmatic interface to query the current status
of an init script that things like Puppet can use.  The current code is an
ugly hack that Luke hates.  He added it at our (Stanford's) request
because it sort of worked, unlike the previous code which just removed all
the init script links, causing them to be re-added on package upgrade.
But no one thinks it's a good solution.

Luke really wants to use an API, not search through the file system, so
that there's some hope of continuing to use the same API if different init
script mechanisms are in place.

-- 
Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>





More information about the Pkg-puppet-devel mailing list