Sha256: ad130302106950b4c2805f61ab8aed914cf16bdc86e0696348535aa7c608305c

Contents?: true

Size: 680 Bytes

Versions: 5

Compression:

Stored size: 680 Bytes

Contents

module Serverspec
  module Commands
    class Debian < Linux
      def check_enabled(service)
        # Until everything uses Upstart, this needs an OR.
        "ls /etc/rc3.d/ | grep -- #{escape(service)} || grep 'start on' /etc/init/#{escape(service)}.conf"      
      end

      def check_installed(package, version=nil)
        escaped_package = escape(package)
        "dpkg -s #{escaped_package} && ! dpkg -s #{escaped_package} | grep -E '^Status: .+ not-installed$'"
      end

      def check_running(service)
        # This is compatible with Debian >Jaunty and Ubuntu derivatives
        "service #{escape(service)} status | grep 'running'"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
serverspec-0.6.12 lib/serverspec/commands/debian.rb
serverspec-0.6.11 lib/serverspec/commands/debian.rb
serverspec-0.6.10 lib/serverspec/commands/debian.rb
serverspec-0.6.9 lib/serverspec/commands/debian.rb
serverspec-0.6.8 lib/serverspec/commands/debian.rb