summaryrefslogtreecommitdiffstats
path: root/docs/src/references/system-config.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src/references/system-config.md')
-rw-r--r--docs/src/references/system-config.md43
1 files changed, 43 insertions, 0 deletions
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.