Sha256: e1b2711f7943502c1efa11fe2421cbd1c031aec2e5952f1182e7392cd469dfff

Contents?: true

Size: 628 Bytes

Versions: 73

Compression:

Stored size: 628 Bytes

Contents

class Specinfra::Command::Solaris::Base::Service < Specinfra::Command::Base::Service
  class << self
    def check_is_enabled(service, level=nil)
      "svcs -l #{escape(service)} 2> /dev/null | egrep '^enabled *true$'"
    end

    def check_is_running(service)
      "svcs -H -o state #{escape(service)} 2> /dev/null | egrep '^online$'"
    end

    def check_has_property(svc, property)
      commands = []
      property.sort.each do |key, value|
        regexp = "^#{value}$"
        commands << "svcprop -p #{escape(key)} #{escape(svc)} | grep -- #{escape(regexp)}"
      end
      commands.join(' && ')
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
specinfra-2.22.0 lib/specinfra/command/solaris/base/service.rb
specinfra-2.21.1 lib/specinfra/command/solaris/base/service.rb
specinfra-2.21.0 lib/specinfra/command/solaris/base/service.rb
specinfra-2.20.2 lib/specinfra/command/solaris/base/service.rb
specinfra-2.20.1 lib/specinfra/command/solaris/base/service.rb
specinfra-2.20.0 lib/specinfra/command/solaris/base/service.rb
specinfra-2.19.6 lib/specinfra/command/solaris/base/service.rb
specinfra-2.19.5 lib/specinfra/command/solaris/base/service.rb
specinfra-2.19.4 lib/specinfra/command/solaris/base/service.rb
specinfra-2.19.3 lib/specinfra/command/solaris/base/service.rb
specinfra-2.19.2 lib/specinfra/command/solaris/base/service.rb
specinfra-2.19.1 lib/specinfra/command/solaris/base/service.rb
specinfra-2.19.0 lib/specinfra/command/solaris/base/service.rb
specinfra-2.18.3 lib/specinfra/command/solaris/base/service.rb
specinfra-2.18.2 lib/specinfra/command/solaris/base/service.rb
specinfra-2.18.1 lib/specinfra/command/solaris/base/service.rb
specinfra-2.18.0 lib/specinfra/command/solaris/base/service.rb
specinfra-2.17.1 lib/specinfra/command/solaris/base/service.rb
specinfra-2.17.0 lib/specinfra/command/solaris/base/service.rb
specinfra-2.16.0 lib/specinfra/command/solaris/base/service.rb