summaryrefslogtreecommitdiff
blob: d90043f0de97cc1073d31d125632fd8b8e018652 (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 2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

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%/*}"
}