summaryrefslogtreecommitdiff
blob: b02458ae16ca5e8a4edd948fa59f38039eb6a5cd (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
#!/sbin/openrc-run
# Copyright 2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

description="peervpn server"
pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
logfile=${logfile:-"/var/log/${SVCNAME}/${SVCNAME}.log"}
user=${SVCNAME}
group=${SVCNAME}

command="/usr/sbin/${SVCNAME}"
command_args="${command_args:-/etc/peervpn/peervpn.conf}"
command_background="true"
# peervpn will drop privileges based on user and group config file settings
start_stop_daemon_args="
	--stdout ${logfile}
	--stderr ${logfile}"

depend() {
	need net
	after net
}

start_pre() {
	checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
}