Sha256: f86bc179a57f7b6492c1fe4f39c9964ac29183231aca314c9bcbe1782d603f9a

Contents?: true

Size: 1.47 KB

Versions: 13

Compression:

Stored size: 1.47 KB

Contents

---
title: About the upstart_service Resource
---

# upstart_service

Use the `upstart_service` InSpec audit resource to test a service using Upstart.

<br>

## Syntax

An `upstart_service` resource block declares the name of a service and then one (or more) matchers to test the state of the service:

    describe upstart_service('service_name') do
      it { should be_installed }
      it { should be_enabled }
      it { should be_running }
    end

where

* `('service_name')` must specify a service name
* `be_installed`, `be_enabled`, and `be_running` are valid matchers for this resource; all matchers available to the `service` resource may be used

The path to the service manager's control may be specified for situations where the path isn't available in the current `PATH`. For example:

    describe upstart_service('service_name', '/path/to/control') do
      it { should be_enabled }
      it { should be_installed }
      it { should be_running }
    end

<br>

## Matchers

This InSpec audit resource has the following matchers. For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).

### be_enabled

The `be_enabled` matcher tests if the named service is enabled:

    it { should be_enabled }

### be_installed

The `be_installed` matcher tests if the named service is installed:

    it { should be_installed }

### be_running

The `be_running` matcher tests if the named service is running:

    it { should be_running }

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
inspec-1.51.0 docs/resources/upstart_service.md.erb
inspec-1.50.1 docs/resources/upstart_service.md.erb
inspec-1.49.2 docs/resources/upstart_service.md.erb
inspec-1.48.0 docs/resources/upstart_service.md.erb
inspec-1.47.0 docs/resources/upstart_service.md.erb
inspec-1.46.2 docs/resources/upstart_service.md.erb
inspec-1.45.13 docs/resources/upstart_service.md.erb
inspec-1.45.9 docs/resources/upstart_service.md.erb
inspec-1.44.8 docs/resources/upstart_service.md.erb
inspec-1.43.8 docs/resources/upstart_service.md.erb
inspec-1.43.5 docs/resources/upstart_service.md.erb
inspec-1.42.3 docs/resources/upstart_service.md.erb
inspec-1.41.0 docs/resources/upstart_service.md.erb