summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorRina Fujino <18257209+rina23q@users.noreply.github.com>2022-01-10 17:57:41 +0100
committerGitHub <noreply@github.com>2022-01-10 17:57:41 +0100
commit3ab4cf779ebacafd5990285d07ccfe03bebaea03 (patch)
treeae8f06bc774a39f2575abf933cb92a04fc710a79 /docs
parent9c4dee566f25a7a3a2b2548a03d0c4a4bf65b66e (diff)
#639 Remove the dependency on systemd (#729)
* The purpose of this change is to get rid of the hard-coded dependencies on systemd from tedge connect/disconnect, to allow users to use other system managers, e.g. OpenRC, initd, etc.. * If /etc/tedge/system.toml exists, tedge connect/disconnect uses the service manager defined in the file. * If the file is not given by user, tedge connect/disconnect uses /bin/systemctl as the service manager. (the same behaviour as we have it so far) * Delete old service implementation files for BSD, OpenRC, systemd, and NULL. * Add system.toml example files for BSD and OpenRC. * Add a reference guide to explain the format of system.toml configuration file. Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/src/SUMMARY.md4
-rw-r--r--docs/src/references/system-config.md43
2 files changed, 46 insertions, 1 deletions
diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md
index 361ba3fd..c4b07ce5 100644
--- a/docs/src/SUMMARY.md
+++ b/docs/src/SUMMARY.md
@@ -53,4 +53,6 @@
- [The `tedge cert` command](./references/tedge-cert.md)
- [The `tedge connect` command](./references/tedge-connect.md)
- [The `tedge disconnect` command](./references/tedge-disconnect.md)
- - [The `tedge mqtt` command](./references/tedge-mqtt.md) \ No newline at end of file
+ - [The `tedge mqtt` command](./references/tedge-mqtt.md)
+
+- [Configuration Reference](./references/system-config.md)
diff --git a/docs/src/references/system-config.md b/docs/src/references/system-config.md
new file mode 100644
index 00000000..cf1815c5
--- /dev/null
+++ b/docs/src/references/system-config.md
@@ -0,0 +1,43 @@
+# System Configuration File
+
+To support multiple system and service manager, `tedge` requires the `/etc/tedge/system.toml` file.
+The file contains configurations about the system manager and the supported actions.
+
+The format of the file is:
+
+```toml
+[init]
+name = "systemd"
+is_available = ["/bin/systemctl", "--version"]
+restart = ["/bin/systemctl", "restart", "{}"]
+stop = ["/bin/systemctl", "stop", "{}"]
+enable = ["/bin/systemctl", "enable", "{}"]
+disable = ["/bin/systemctl", "disable", "{}"]
+is_active = ["/bin/systemctl", "is-active", "{}"]
+```
+
+## Placeholder
+
+`{}` will be replaced by a service name (`mosquitto`, `tedge-mapper-c8y`, `tedge-mapper-az`, etc.).
+For example,
+
+```toml
+restart = ["/bin/systemctl", "restart", "{}"]
+```
+
+will be interpreted as
+
+```shell
+/bin/systemctl restart mosquitto
+```
+
+## Keys
+
+- **name**: An identifier of the system manager.
+ It is used in the output of `tedge connect` and `tedge disconnect`.
+- **is_available**: The command to check if the system manager is available on your system.
+- **restart**: The command to restart a service by the system manager.
+- **stop**: The command to stop a service by the system manager.
+- **enable**: The command to enable a service by the system manager.
+- **disable**: The command to disable a service by the system manager.
+- **is_active**: The command to check if the service is running by the system manager.