summaryrefslogtreecommitdiff
blob: 3a8b36eda99cf4430a68a0d189b2e168ca6adb37 (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
#!/sbin/openrc-run
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
SR_USER=strelaysrv
SR_GROUP=syncthing
SR_HOMEDIR=/var/lib/syncthing-relaysrv
SR_LOGFILE=/var/log/syncthing/relaysrv.log


description="Relay service for syncthing"
command="/usr/libexec/syncthing/strelaysrv"
command_args="${SR_OPTS}"
pidfile="/run/syncthing-relaysrv.pid"
command_background="yes"
command_user="${SR_USER}:${SR_GROUP}"
directory="${SR_HOMEDIR}"
output_log="${SR_LOGFILE}"
error_log="${SR_LOGFILE}"

depend() {
  need net
}

start_pre() {
  checkpath -q -d -o ${SR_USER}:${SR_GROUP} ${SR_HOMEDIR}
  checkpath -q -f -o ${SR_USER}:${SR_GROUP} ${SR_LOGFILE}
}