summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2016-04-11 03:41:43 -0700
committerZac Medico <zmedico@gentoo.org>2016-04-11 03:41:43 -0700
commit5634d7bf2f68d21408eb0007035291c509cd89f2 (patch)
tree9a2eae11b057284ebd2b124dace94908f1fa2d59 /net-misc/peervpn/files
parentwww-plugins/adobe-flash: x86 stable wrt bug #579166 (diff)
downloadgentoo-5634d7bf2f68d21408eb0007035291c509cd89f2.tar.gz
gentoo-5634d7bf2f68d21408eb0007035291c509cd89f2.tar.bz2
gentoo-5634d7bf2f68d21408eb0007035291c509cd89f2.zip
net-misc/peervpn: new package
Package-Manager: portage-2.2.28
Diffstat (limited to 'net-misc/peervpn/files')
-rw-r--r--net-misc/peervpn/files/peervpn.initd31
-rw-r--r--net-misc/peervpn/files/peervpn.logrotated7
-rw-r--r--net-misc/peervpn/files/peervpn.service12
3 files changed, 50 insertions, 0 deletions
diff --git a/net-misc/peervpn/files/peervpn.initd b/net-misc/peervpn/files/peervpn.initd
new file mode 100644
index 000000000000..3174dc67f683
--- /dev/null
+++ b/net-misc/peervpn/files/peervpn.initd
@@ -0,0 +1,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}"
+}
diff --git a/net-misc/peervpn/files/peervpn.logrotated b/net-misc/peervpn/files/peervpn.logrotated
new file mode 100644
index 000000000000..d66c2fa6802b
--- /dev/null
+++ b/net-misc/peervpn/files/peervpn.logrotated
@@ -0,0 +1,7 @@
+/var/log/peervpn/peervpn.log {
+ su peervpn peervpn
+ missingok
+ size 5M
+ rotate 3
+ compress
+}
diff --git a/net-misc/peervpn/files/peervpn.service b/net-misc/peervpn/files/peervpn.service
new file mode 100644
index 000000000000..13c5310f517b
--- /dev/null
+++ b/net-misc/peervpn/files/peervpn.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=peervpn server
+Requires=network-online.target
+After=network-online.target
+
+[Service]
+Environment=PEERVPN_OPTS="/etc/peervpn/peervpn.conf"
+ExecStart=/usr/sbin/peervpn $PEERVPN_OPTS
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target