aboutsummaryrefslogtreecommitdiffstats
path: root/testing/synapse/synapse.initd
blob: f5b46369f2961d122209f35fa1b56252c38e2b05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/sbin/openrc-run
supervisor=supervise-daemon

name="synapse"
description="Daemon for Synapse, the Matrix reference homeserver"

: ${command_user:="synapse:synapse"}
: ${config:="/etc/synapse/homesever.yaml"}

command="/usr/bin/python3"
command_args="-m synapse.app.homeserver --config-path=$config $command_args"

pidfile="/run/${RC_SVCNAME}.pid"

depends() {
	need net
}

start_pre() {
	# /var/lib/synapse needs to be owned by the synapse user and so does the config location
	checkpath --directory --owner "$command_user" /var/lib/synapse
	checkpath --file --owner "$command_user" $config
}