blob: c760b1d02165856c2a00d5f0e1af642cad0ffd53 (
plain)
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
29
30
31
32
33
34
|
#!/sbin/openrc-run
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# shellcheck shell=sh
export NO_COLOR=1
export TUWUNEL_CONFIG=${CONDUIT_CONFIG:-/etc/tuwunel/tuwunel.toml}
export TUWUNEL_PID_FILE=${TUWUNEL_PID_FILE:-/run/${RC_SVCNAME}.pid}
export TUWUNEL_LOG_DIR=${TUWUNEL_LOG_DIR:-/var/log/tuwunel}
export TUWUNEL_USER=${TUWUNEL_USER:-tuwunel}
export TUWUNEL_GROUP=${TUWUNEL_GROUP:-tuwunel}
description="Tuwunel [matrix] homeserver"
supervisor="supervise-daemon"
command="/usr/bin/tuwunel"
command_user="${TUWUNEL_USER}:${TUWUNEL_GROUP}"
pidfile="${TUWUNEL_PID_FILE}"
output_log="${TUWUNEL_LOG_DIR}/tuwunel.log"
error_log="${TUWUNEL_LOG_DIR}/tuwunel.err"
required_files="${TUWUNEL_CONFIG}"
start_stop_daemon_args="${start_stop_daemon_args} -- -c ${TUWUNEL_CONFIG}"
depend() {
need net
}
start_pre() {
checkpath -f -m 0640 -o "${command_user}" "${output_log}"
checkpath -f -m 0640 -o "${command_user}" "${error_log}"
}
|