Sha256: 86c91b274395dbd5c92bc70c481c398a7e9d17149a507b43073790ed7cffe7dd

Contents?: true

Size: 1.62 KB

Versions: 52

Compression:

Stored size: 1.62 KB

Contents

---
title: About the bsd_service Resource
---

# bsd_service

Use the `bsd_service` InSpec audit resource to test a service using a Berkeley OS-style `init` on the FreeBSD platform.

## Syntax

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

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

52 entries across 52 versions & 1 rubygems

Version Path
inspec-1.40.0 docs/resources/bsd_service.md.erb
inspec-1.39.1 docs/resources/bsd_service.md.erb
inspec-1.38.8 docs/resources/bsd_service.md.erb
inspec-1.37.6 docs/resources/bsd_service.md.erb
inspec-1.36.1 docs/resources/bsd_service.md.erb
inspec-1.35.1 docs/resources/bsd_service.md.erb
inspec-1.34.1 docs/resources/bsd_service.md.erb
inspec-1.33.12 docs/resources/bsd_service.md.erb
inspec-1.33.1 docs/resources/bsd_service.md.erb
inspec-1.32.1 docs/resources/bsd_service.md.erb
inspec-1.31.1 docs/resources/bsd_service.md.erb
inspec-1.31.0 docs/resources/bsd_service.md.erb
inspec-1.30.0 docs/resources/bsd_service.md.erb
inspec-1.29.0 docs/resources/bsd_service.md.erb
inspec-1.28.1 docs/resources/bsd_service.md.erb
inspec-1.28.0 docs/resources/bsd_service.md.erb
inspec-1.27.0 docs/resources/bsd_service.md.erb
inspec-1.26.0 docs/resources/bsd_service.md.erb
inspec-1.25.1 docs/resources/bsd_service.md.erb
inspec-1.25.0 docs/resources/bsd_service.md.erb