Sha256: e5e4c479253495bcd16bbe6131a0d4b6dbc6f5e3c3fb0474f5979d706990729c

Contents?: true

Size: 1.44 KB

Versions: 42

Compression:

Stored size: 1.44 KB

Contents

---
title: About the upstart_service Resource
platform: linux
---

# 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

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

42 entries across 42 versions & 2 rubygems

Version Path
inspec-core-2.2.55 docs/resources/upstart_service.md.erb
inspec-2.2.55 docs/resources/upstart_service.md.erb
inspec-core-2.2.54 docs/resources/upstart_service.md.erb
inspec-2.2.54 docs/resources/upstart_service.md.erb
inspec-core-2.2.50 docs/resources/upstart_service.md.erb
inspec-2.2.50 docs/resources/upstart_service.md.erb
inspec-core-2.2.41 docs/resources/upstart_service.md.erb
inspec-2.2.41 docs/resources/upstart_service.md.erb
inspec-core-2.2.35 docs/resources/upstart_service.md.erb
inspec-2.2.35 docs/resources/upstart_service.md.erb
inspec-core-2.2.34 docs/resources/upstart_service.md.erb
inspec-2.2.34 docs/resources/upstart_service.md.erb
inspec-core-2.2.27 docs/resources/upstart_service.md.erb
inspec-2.2.27 docs/resources/upstart_service.md.erb
inspec-core-2.2.20 docs/resources/upstart_service.md.erb
inspec-2.2.20 docs/resources/upstart_service.md.erb
inspec-core-2.2.16 docs/resources/upstart_service.md.erb
inspec-2.2.16 docs/resources/upstart_service.md.erb
inspec-core-2.2.10 docs/resources/upstart_service.md.erb
inspec-2.2.10 docs/resources/upstart_service.md.erb