Add systemd docs.
This commit is contained in:
parent
8c0957c6f1
commit
bc07cdc5eb
39
docs/src/recipes/os/systemd.md
Normal file
39
docs/src/recipes/os/systemd.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Systemd
|
||||||
|
|
||||||
|
Systemd is a service manager, used in some Linux distributions.
|
||||||
|
|
||||||
|
This Scone module allows declaring units, enabling them, and marking them to be started.
|
||||||
|
|
||||||
|
| Recipe | Needs | Provides |
|
||||||
|
| -----: | ----- | -------- |
|
||||||
|
| [`systemd`](#systemd) | `file`? | |
|
||||||
|
|
||||||
|
|
||||||
|
## `systemd`: Systemd unit
|
||||||
|
|
||||||
|
Declares and optionally enables and/or starts a systemd unit.
|
||||||
|
|
||||||
|
**Note:** probably must be run as the `root` user.
|
||||||
|
|
||||||
|
**Preconditions:** if `already_installed` is `true`, the specified unit must already be available for systemd.
|
||||||
|
|
||||||
|
| Argument | Accepted Values | Default | Description |
|
||||||
|
| -------: | --------------- | ------- | ----------- |
|
||||||
|
| unit | any systemd unit name string | *required* | Name of the Systemd unit. If no extension is provided, `.service` will be inferred. |
|
||||||
|
| at | a path | *semi-optional* | If specified, the path to where the . |
|
||||||
|
| already_installed | true, false | false | If true, no path is needed, as it will be assumed that the unit is already available. |
|
||||||
|
| enabled | true, false | *optional* | If true, the unit will be enabled ('installed'). |
|
||||||
|
| started | true, false | *optional* | If true, the unit will be started. |
|
||||||
|
| ~~restart_on~~ | ~~list of paths~~ | *optional* | **NOT IMPLEMENTED** ~~a list of files to which changes will cause the unit to be restarted.~~ reloaded? |
|
||||||
|
|
||||||
|
It is an error to not specify **at** if **already_installed** is not specified as true.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```scoml
|
||||||
|
[[systemd]] Enable the gitea service
|
||||||
|
unit = "gitea"
|
||||||
|
at = "/etc/systemd/system/gitea.service"
|
||||||
|
enabled = true
|
||||||
|
started = true
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user