summaryrefslogtreecommitdiffstats
path: root/net-im/dendrite/files/dendrite.initd
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/dendrite/files/dendrite.initd')
-rw-r--r--net-im/dendrite/files/dendrite.initd27
1 files changed, 27 insertions, 0 deletions
diff --git a/net-im/dendrite/files/dendrite.initd b/net-im/dendrite/files/dendrite.initd
new file mode 100644
index 0000000..ee210a2
--- /dev/null
+++ b/net-im/dendrite/files/dendrite.initd
@@ -0,0 +1,27 @@
+#!/sbin/openrc-run
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="dendrite daemon"
+description="Dendrite (Matrix Homeserver)"
+command=/usr/bin/dendrite
+command_args="--config /etc/dendrite/dendrite.yaml ${EXTRA_ARGS}"
+pidfile="/run/dendrite.pid"
+command_background="yes"
+command_user="dendrite:dendrite"
+directory="/var/lib/dendrite"
+output_log="/var/log/dendrite/dendrite.log"
+error_log="/var/log/dendrite/dendrite.log"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ _pem="/var/lib/dendrite/matrix_key.pem"
+ if [ ! -e "${_pem}" ]; then
+ /usr/bin/generate-keys --private-key "${_pem}"
+ chown dendrite:dendrite "${_pem}"
+ chmod 600 "${_pem}"
+ fi
+}