Sha256: 9c98212f6cab3de0a9e03f78dca45403c838b79139e5ff4a5eb68c2d463b8bf2

Contents?: true

Size: 1.61 KB

Versions: 20

Compression:

Stored size: 1.61 KB

Contents

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

# runit_service

Use the `runit_service` InSpec audit resource to test a service using runit.

<br>

## Availability

### Installation

This resource is distributed along with InSpec itself. You can use it automatically.

### Version

This resource first became available in v1.0.0 of InSpec.

## Syntax

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

    describe runit_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 runit_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

20 entries across 20 versions & 2 rubygems

Version Path
inspec-core-2.3.10 docs/resources/runit_service.md.erb
inspec-2.3.10 docs/resources/runit_service.md.erb
inspec-core-2.3.5 docs/resources/runit_service.md.erb
inspec-2.3.5 docs/resources/runit_service.md.erb
inspec-core-2.3.4 docs/resources/runit_service.md.erb
inspec-2.3.4 docs/resources/runit_service.md.erb
inspec-core-2.2.112 docs/resources/runit_service.md.erb
inspec-2.2.112 docs/resources/runit_service.md.erb
inspec-core-2.2.102 docs/resources/runit_service.md.erb
inspec-2.2.102 docs/resources/runit_service.md.erb
inspec-core-2.2.101 docs/resources/runit_service.md.erb
inspec-2.2.101 docs/resources/runit_service.md.erb
inspec-core-2.2.78 docs/resources/runit_service.md.erb
inspec-2.2.78 docs/resources/runit_service.md.erb
inspec-core-2.2.70 docs/resources/runit_service.md.erb
inspec-2.2.70 docs/resources/runit_service.md.erb
inspec-core-2.2.64 docs/resources/runit_service.md.erb
inspec-2.2.64 docs/resources/runit_service.md.erb
inspec-core-2.2.61 docs/resources/runit_service.md.erb
inspec-2.2.61 docs/resources/runit_service.md.erb