summaryrefslogtreecommitdiffstats
path: root/configuration/contrib
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 /configuration/contrib
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 'configuration/contrib')
-rw-r--r--configuration/contrib/system/bsd/system.toml8
-rw-r--r--configuration/contrib/system/openrc/system.toml8
-rw-r--r--configuration/contrib/system/systemd/system.toml8
3 files changed, 24 insertions, 0 deletions
diff --git a/configuration/contrib/system/bsd/system.toml b/configuration/contrib/system/bsd/system.toml
new file mode 100644
index 00000000..05f500f5
--- /dev/null
+++ b/configuration/contrib/system/bsd/system.toml
@@ -0,0 +1,8 @@
+[init]
+name = "service(8)"
+is_available = ["/usr/sbin/service", "-l"]
+restart = ["/usr/sbin/service", "{}", "restart"]
+stop = ["/usr/sbin/service", "{}", "stop"]
+enable = ["/usr/sbin/service", "{}", "enable"]
+disable = ["/usr/sbin/service", "{}", "forcedisable"]
+is_active = ["/usr/sbin/service", "{}", "status"]
diff --git a/configuration/contrib/system/openrc/system.toml b/configuration/contrib/system/openrc/system.toml
new file mode 100644
index 00000000..cf3a72d0
--- /dev/null
+++ b/configuration/contrib/system/openrc/system.toml
@@ -0,0 +1,8 @@
+[init]
+name = "OpenRC"
+is_available = ["/sbin/rc-service", "-l"]
+restart = ["/sbin/rc-service", "{}", "restart"]
+stop = ["/sbin/rc-service", "{}", "stop"]
+enable = ["/sbin/rc-update", "add", "{}"]
+disable = ["/sbin/rc-update", "delete", "{}"]
+is_active = ["/sbin/rc-service", "{}", "status"]
diff --git a/configuration/contrib/system/systemd/system.toml b/configuration/contrib/system/systemd/system.toml
new file mode 100644
index 00000000..bb1fc2c5
--- /dev/null
+++ b/configuration/contrib/system/systemd/system.toml
@@ -0,0 +1,8 @@
+[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", "{}"]