Sha256: ca8421268a837161763435cce7711c6d4485352fc296d75442c421024caf3697

Contents?: true

Size: 690 Bytes

Versions: 16

Compression:

Stored size: 690 Bytes

Contents

module Serverspec
  module Commands
    class Debian < Linux
      def check_enabled(service, level=3)
        # Until everything uses Upstart, this needs an OR.
        "ls /etc/rc#{level}.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

16 entries across 16 versions & 1 rubygems

Version Path
serverspec-0.7.8 lib/serverspec/commands/debian.rb
serverspec-0.7.7 lib/serverspec/commands/debian.rb
serverspec-0.7.6 lib/serverspec/commands/debian.rb
serverspec-0.7.5 lib/serverspec/commands/debian.rb
serverspec-0.7.4 lib/serverspec/commands/debian.rb
serverspec-0.7.3 lib/serverspec/commands/debian.rb
serverspec-0.7.2 lib/serverspec/commands/debian.rb
serverspec-0.7.1 lib/serverspec/commands/debian.rb
serverspec-0.7.0 lib/serverspec/commands/debian.rb
serverspec-0.6.30 lib/serverspec/commands/debian.rb
serverspec-0.6.29 lib/serverspec/commands/debian.rb
serverspec-0.6.28 lib/serverspec/commands/debian.rb
serverspec-0.6.27 lib/serverspec/commands/debian.rb
serverspec-0.6.26 lib/serverspec/commands/debian.rb
serverspec-0.6.25 lib/serverspec/commands/debian.rb
serverspec-0.6.24 lib/serverspec/commands/debian.rb