aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authormandree <mandree@FreeBSD.org>2011-08-31 01:12:31 +0800
committermandree <mandree@FreeBSD.org>2011-08-31 01:12:31 +0800
commit85709a4aa050a0bd886e3120ebe05261a21316db (patch)
tree529380a9147a71e88572c9a704a03f01c5475b44 /security
parent346484172036f650e5890bdf956d2474909bd07f (diff)
downloadfreebsd-ports-gnome-85709a4aa050a0bd886e3120ebe05261a21316db.tar.gz
freebsd-ports-gnome-85709a4aa050a0bd886e3120ebe05261a21316db.tar.zst
freebsd-ports-gnome-85709a4aa050a0bd886e3120ebe05261a21316db.zip
Use recently bugfixed rc script from ../openvpn port.
Diffstat (limited to 'security')
-rw-r--r--security/openvpn20/Makefile2
-rw-r--r--security/openvpn20/files/openvpn.sh.in37
2 files changed, 20 insertions, 19 deletions
diff --git a/security/openvpn20/Makefile b/security/openvpn20/Makefile
index 5ec8bddcb43e..ed49502aa84b 100644
--- a/security/openvpn20/Makefile
+++ b/security/openvpn20/Makefile
@@ -7,7 +7,7 @@
PORTNAME= openvpn
PORTVERSION= 2.0.9
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security net
# MASTER_SITES points to hosts in distinct data centers,
# so just one MASTER_SITES entry should be OK.
diff --git a/security/openvpn20/files/openvpn.sh.in b/security/openvpn20/files/openvpn.sh.in
index b80fe1560c74..d2539131a212 100644
--- a/security/openvpn20/files/openvpn.sh.in
+++ b/security/openvpn20/files/openvpn.sh.in
@@ -2,10 +2,11 @@
#
# openvpn.sh - load tun/tap driver and start OpenVPN daemon
#
-# (C) Copyright 2005 - 2008 by Matthias Andree
+# (C) Copyright 2005 - 2008, 2010 by Matthias Andree
# based on suggestions by Matthias Grimm and Dirk Gouders
# with multi-instance contribution from Denis Shaposhnikov, Gleb Kozyrev
# and Vasil Dimov
+# softrestart feature suggested by Nick Hibma
#
# $FreeBSD$
#
@@ -45,6 +46,7 @@
#
# NAME_enable="NO" # set to YES to enable openvpn
# NAME_if= # driver(s) to load, set to "tun", "tap" or "tun tap"
+# # it is OK to specify the if_ prefix.
#
# # optional:
# NAME_flags= # additional command line arguments
@@ -77,26 +79,21 @@ name="${name##*/}"
rcvar=$(set_rcvar)
-openvpn_precmd()
+stop_postcmd()
{
- for i in $interfaces ; do
- if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 ; then
- if ! kldload if_${i} ; then
- warn "Could not load $i module."
- return 1
- fi
- fi
- done
- return 0
+ rm -f "$pidfile" || warn "Could not remove $pidfile."
}
-stop_postcmd()
+softrestart()
{
- rm -f "$pidfile" || warn "Could not remove $pidfile."
+ sig_reload=USR1 run_rc_command reload
+ exit $?
}
-# support SIGHUP to reparse configuration file
-extra_commands="reload"
+# reload: support SIGHUP to reparse configuration file
+# softrestart: support SIGUSR1 to reconnect without superuser privileges
+extra_commands="reload softrestart"
+softrestart_cmd="softrestart"
# pidfile
pidfile="/var/run/${name}.pid"
@@ -104,9 +101,7 @@ pidfile="/var/run/${name}.pid"
# command and arguments
command="%%PREFIX%%/sbin/openvpn"
-# run this first
-start_precmd="openvpn_precmd"
-# and this last
+# run this last
stop_postcmd="stop_postcmd"
load_rc_config ${name}
@@ -119,7 +114,13 @@ configfile="$(eval echo \${${name}_configfile})"
dir="$(eval echo \${${name}_dir})"
interfaces="$(eval echo \${${name}_if})"
+required_modules=
+for i in $interfaces ; do
+ required_modules="$required_modules${required_modules:+" "}if_${i#if_}"
+done
+
required_files=${configfile}
+
command_args="--cd ${dir} --daemon ${name} --config ${configfile} --writepid ${pidfile}"
run_rc_command "$1"