document how to add a dropin file with Hiera
This commit is contained in:
@@ -13,31 +13,6 @@ base::services:
|
||||
```
|
||||
The key inside is the `systemd` service name without the `.service` suffix.
|
||||
|
||||
## Extend/Override Unit File Entries with a Dropin
|
||||
You can create a dropin file by setting `dropin` to `true` and add the content of the dropin unit file below the `options` key, as in following examples:
|
||||
```
|
||||
base::services:
|
||||
netdata:
|
||||
enable: true
|
||||
dropin: true
|
||||
options:
|
||||
Service:
|
||||
Environment: "FOO=bar"
|
||||
```
|
||||
or if there is more than one value for the same key:
|
||||
```
|
||||
base::services:
|
||||
netdata:
|
||||
enable: true
|
||||
dropin: true
|
||||
options:
|
||||
Service:
|
||||
Environment:
|
||||
- "FOO=bar"
|
||||
- "BIZ=buz"
|
||||
```
|
||||
|
||||
|
||||
## Disabling/Stopping a Service
|
||||
|
||||
To stop and disable an already running service, disable it in the `base::services` Hiera key with `enable: false`:
|
||||
@@ -90,6 +65,14 @@ base::services:
|
||||
RemainAfterExit: 'true'
|
||||
```
|
||||
|
||||
If you need to set multiple values, then put the values into an list:
|
||||
```
|
||||
Service:
|
||||
Environment:
|
||||
- "FOO=bar"
|
||||
- "BIZ=buz"
|
||||
```
|
||||
|
||||
## Enhance a Service with a Dropin Unit File
|
||||
It is possible to fine-tune already existing `systemd` unit files with dropins. These are placed as `.conf` files in `/etc/systemd/system/$SERVICE.service.d/`.
|
||||
|
||||
@@ -99,8 +82,23 @@ base::services:
|
||||
'name_of_enhanced_service':
|
||||
enable: true
|
||||
dropin: true
|
||||
options:
|
||||
...
|
||||
options:
|
||||
...
|
||||
```
|
||||
Often this is done to start the service with different options, then you need to reset the orginal value with an emty entry:
|
||||
|
||||
```
|
||||
base::services:
|
||||
'name_of_enhanced_service':
|
||||
enable: true
|
||||
dropin: true
|
||||
options:
|
||||
Service:
|
||||
ExecStart:
|
||||
- ''
|
||||
- '/usr/sbin/my_service --verbose'
|
||||
```
|
||||
|
||||
If there are multiple dropins, you might also name them individually with the `dropin_name` parameter.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user