Issue #5908 has been updated by Matt Robinson.

Here's an attempt at using disable only when sysv-rc package version is greater 
than or equal to 2.88, which seems to be where using `update-rc.d stop` stops 
working.  

    diff --git a/lib/puppet/provider/service/debian.rb 
b/lib/puppet/provider/service/debian.rb
    index 3d09e28..4ac8333 100755
    --- a/lib/puppet/provider/service/debian.rb
    +++ b/lib/puppet/provider/service/debian.rb
    @@ -21,9 +21,12 @@ Puppet::Type.type(:service).provide :debian, :parent => 
:init do
       end

       # Remove the symlinks
    -  def disable
    -    update_rc "-f", @resource[:name], "remove"
    -    update_rc @resource[:name], "stop", "00", "1", "2", "3", "4", "5", 
"6", "."
    +  def disable    # update-rc.d has problems with stop in package versions 
of sysv-rc >= 2.88 Ticket #5908
    +    if `dpkg --compare-versions $(dpkg-query -W --showformat '${Version}' 
sysv-rc) ge 2.88`.to_i == 0
    +      update_rc @resource[:name], "disable"
    +    else
    +      update_rc "-f", @resource[:name], "remove"      update_rc 
@resource[:name], "stop", "00", "1", "2", "3", "4", "5", "6", "."
    +    end
       end

Micah, as you say, both disable and enable fail when the symlinks aren't 
present, which happens when remove is called first.  So I'd rather not use 
enable and disable unless we have to since defaults and stop both work except 
where the sysv-rc package is newer.  Also, as Nigel pointed out running newer 
versions of update-rc.d outputs the foreboding text `the disable|enable API is 
not stable and might change in the future.`
----------------------------------------
Bug #5908: Service Provider on Debian unable to disable services: now uses 
update-rc.d enable/disable
https://projects.puppetlabs.com/issues/5908

Author: Stig Sandbeck Mathisen
Status: Needs More Information
Priority: Urgent
Assignee: 
Category: service
Target version: 2.6.x
Affected Puppet version: 0.25.4
Keywords: provider, debian, service, update-rc.d
Branch: http://github.com/jamtur01/puppet/tree/tickets/2.6.x/5908


The debian provider of the service type now use update-rc.d "enable" and 
"disable", and lets "insserv" select which priorities to use for the symlinks.  
This is also true for non-upstart init scripts on Ubuntu.

The following commit, contributed by Martin F Krafft, can be merged to fix this 
issue:

Repo: git://git.debian.org/pkg-puppet/puppet.git

Commit: 83d88e218b5f8c940c4f2cc5ba33d3e976ed66bf

Gitweb: 
http://git.debian.org/?p=pkg-puppet/puppet.git;a=commit;h=83d88e218b5f8c940c4f2cc5ba33d3e976ed66bf




-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to