systemd — systemd units and services

The systemd check searches the list of running systemd units and services, and asserts that units are running, stopped, or missing.


Check that a service is running:

service = 'sshd'

Check that a service is stopped:

service = 'httpd'
state = 'stopped'

List of parameters

servicestringName of the systemd service.
statestringState of the systemd service. This can be 'running', 'stopped', or 'missing'