blob: 3174dc67f683f366b0e9ed5b4a4a27653530986c (
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
|
#!/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%/*}"
}
start_post() {
chown "${user}":"${group}" "${logfile}"
}
|