diff --git a/docs/src/recipes/os/systemd.md b/docs/src/recipes/os/systemd.md new file mode 100644 index 0000000..14c0463 --- /dev/null +++ b/docs/src/recipes/os/systemd.md @@ -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 +```