Sha256: f55810066cae2e15913884fec7fd898253d08dac3e3ffbada88d9b1aff8995be

Contents?: true

Size: 803 Bytes

Versions: 103

Compression:

Stored size: 803 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

103 entries across 103 versions & 1 rubygems

Version Path
specinfra-2.1.0 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.4 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.3 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.2 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.1 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta52 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta51 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta50 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta49 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta48 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta47 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta46 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta45 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta44 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta43 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta42 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta41 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta40 lib/specinfra/command/debian/base/service.rb
specinfra-2.0.0.beta39 lib/specinfra/command/debian/base/service.rb