Use the runit_service Chef InSpec audit resource to test a service using runit.
This resource is distributed along with Chef InSpec itself. You can use it automatically.
This resource first became available in v1.0.0 of InSpec.
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 namebe_installed, be_enabled, and be_running are valid matchers for this resource; all matchers available to the service resource may be usedThe 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
For a full list of available matchers, please visit our matchers page.
The be_enabled matcher tests if the named service is enabled:
it { should be_enabled }
The be_installed matcher tests if the named service is installed:
it { should be_installed }
The be_running matcher tests if the named service is running:
it { should be_running }
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/runit_service/