Sha256: 1f1e839c38e1ee2c7f7d637ed2d331d1b271701d76f678e05d3da8243b351fac

Contents?: true

Size: 1.58 KB

Versions: 2

Compression:

Stored size: 1.58 KB

Contents

---
title: About the runit_service Resource
---

# runit_service

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

# 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

# Matchers

This InSpec audit resource has the following matchers:

## be

<%= partial "/shared/matcher_be" %>

## 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 }

## cmp

<%= partial "/shared/matcher_cmp" %>

## eq

<%= partial "/shared/matcher_eq" %>

## include

<%= partial "/shared/matcher_include" %>

## match

<%= partial "/shared/matcher_match" %>

# Examples

None.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inspec-1.0.0 docs/resources/runit_service.md.erb
inspec-1.0.0.beta3 docs/resources/runit_service.md.erb