summaryrefslogtreecommitdiffstats
path: root/net-im/dendrite/files/dendrite-monolith.initd
blob: 52dba9e01ab9ebf5ab651c153a527393b18a33af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/sbin/openrc-run
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

name="dendrite-monolith daemon"
description="Dendrite (Matrix Homeserver)"
command=/usr/bin/dendrite-monolith-server
command_args="--config /etc/dendrite/dendrite.monolith.yaml ${EXTRA_ARGS}"
pidfile="/run/dendrite-monolith.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
	ulimit -n 65535
}