Service
The service resource manages system services. Services have two independent properties: whether they are running and whether they are enabled to start at boot.
Warning
Use real service names, not virtual names or aliases.
Services can subscribe to other resources and restart when those resources change.
Ensure Values
| Value | Description |
|---|---|
running | The service must be running |
stopped | The service must be stopped |
If ensure is not specified, it defaults to running.
Properties
| Property | Description |
|---|---|
name | Service name |
ensure | Desired state (running or stopped; default: running) |
enable (boolean) | Enable the service to start at boot |
subscribe (array) | Resources to watch; restart the service when they change (type#name or type#alias) |
provider | Force a specific provider (systemd only) |