Sha256: 0c9816176dcc42944c9d02c47bad8d4975cf839eca6af82a4263deec497c8038

Contents?: true

Size: 804 Bytes

Versions: 52

Compression:

Stored size: 804 Bytes

Contents

class Specinfra::Command::Debian::Base::Service < Specinfra::Command::Linux::Base::Service
  class << self
    def check_is_enabled(service, level=3)
      # Until everything uses Upstart, this needs an OR.
      "ls /etc/rc#{level}.d/ | grep -- '^S..#{escape(service)}$' || grep 'start on' /etc/init/#{escape(service)}.conf"
    end

    def enable(service)
      "update-rc.d #{escape(service)} defaults"
    end

    def disable(service)
      "update-rc.d -f #{escape(service)} remove"
    end

    def start(service)
      "service #{escape(service)} start"
    end

    def stop(service)
      "service #{escape(service)} stop"
    end

    def restart(service)
      "service #{escape(service)} restart"
    end

    def reload(service)
      "service #{escape(service)} reload"
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
specinfra-2.39.0 lib/specinfra/command/debian/base/service.rb
specinfra-2.38.1 lib/specinfra/command/debian/base/service.rb
specinfra-2.38.0 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.9 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.8 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.6 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.5 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.4 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.3 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.2 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.1 lib/specinfra/command/debian/base/service.rb
specinfra-2.37.0 lib/specinfra/command/debian/base/service.rb
specinfra-2.36.18 lib/specinfra/command/debian/base/service.rb
specinfra-2.36.17 lib/specinfra/command/debian/base/service.rb
specinfra-2.36.16 lib/specinfra/command/debian/base/service.rb
specinfra-2.36.15 lib/specinfra/command/debian/base/service.rb
specinfra-2.36.14 lib/specinfra/command/debian/base/service.rb
specinfra-2.36.13 lib/specinfra/command/debian/base/service.rb
specinfra-2.36.12 lib/specinfra/command/debian/base/service.rb
specinfra-2.36.11 lib/specinfra/command/debian/base/service.rb