Sha256: 124239e39c44b994799b49d3393731cb69a1cc3825b4a9f143439d328105755b

Contents?: true

Size: 941 Bytes

Versions: 3

Compression:

Stored size: 941 Bytes

Contents

# Manage debian services.  Start/stop is the same as InitSvc, but enable/disable
# is special.
Puppet::Type.type(:service).provide :debian, :parent => :init do
    desc "Debian's form of ``init``-style management.  The only difference
        is that this supports service enabling and disabling via ``update-rc.d``."

    commands :update => "/usr/sbin/update-rc.d"
    defaultfor :operatingsystem => :debian

    # Remove the symlinks
    def disable
        update "-f", @resource[:name], "remove"
    end

    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|Nothing to do\./
            return :true
        else
            return :false
        end
    end

    def enable
        update @resource[:name], "defaults"
    end
end

# $Id: debian.rb 2501 2007-05-09 23:08:42Z luke $

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puppet-0.23.0 lib/puppet/provider/service/debian.rb
puppet-0.23.2 lib/puppet/provider/service/debian.rb
puppet-0.23.1 lib/puppet/provider/service/debian.rb