summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2007-07-08 11:36:57 +0000
committerRoy Marples <uberlord@gentoo.org>2007-07-08 11:36:57 +0000
commit9af0b6ef7e6bbb58c469f8d093b0a7a90398539e (patch)
treec9bf0b0bde75186f96c4abe8054e7a270f1e7eba /net-misc/openvpn/files
parentFix fbsd, bug#184535, thanks to lavajoe (diff)
downloadgentoo-2-9af0b6ef7e6bbb58c469f8d093b0a7a90398539e.tar.gz
gentoo-2-9af0b6ef7e6bbb58c469f8d093b0a7a90398539e.tar.bz2
gentoo-2-9af0b6ef7e6bbb58c469f8d093b0a7a90398539e.zip
RE_ENTER config variable allows custom up/down scripts to re-enter openvpn. Should fix #133107.
(Portage version: 2.1.3_rc6)
Diffstat (limited to 'net-misc/openvpn/files')
-rw-r--r--net-misc/openvpn/files/openvpn-2.1.conf7
-rwxr-xr-xnet-misc/openvpn/files/openvpn-2.1.init6
2 files changed, 10 insertions, 3 deletions
diff --git a/net-misc/openvpn/files/openvpn-2.1.conf b/net-misc/openvpn/files/openvpn-2.1.conf
index 1ed477e6eab7..17c93dc07f31 100644
--- a/net-misc/openvpn/files/openvpn-2.1.conf
+++ b/net-misc/openvpn/files/openvpn-2.1.conf
@@ -4,3 +4,10 @@
# OpenVPN configuration looks like a client, but it's really a peer or
# something else. DETECT_CLIENT controls this behaviour.
DETECT_CLIENT="yes"
+
+# If DETECT_CLIENT is no and you have your own scripts to re-enter the openvpn
+# init script (ie, it first becomes "inactive" and the script then starts the
+# script again to make it "started") then you can state this below.
+# In other words, unless you understand service dependencies and are a
+# competent shell scripter, don't set this.
+RE_ENTER="no"
diff --git a/net-misc/openvpn/files/openvpn-2.1.init b/net-misc/openvpn/files/openvpn-2.1.init
index 52f111a86ed9..b61456334ae9 100755
--- a/net-misc/openvpn/files/openvpn-2.1.init
+++ b/net-misc/openvpn/files/openvpn-2.1.init
@@ -65,7 +65,7 @@ start() {
checkconfig || return 1
- local args="" client=false
+ local args="" reenter=${RE_ENTER:-no}
# If the config file does not specify the cd option, we do
# But if we specify it, we override the config option which we do not want
if ! grep -q "^[ \t]*cd[ \t].*" "${VPNCONF}" ; then
@@ -77,7 +77,7 @@ start() {
# which configures our DNS if any and marks us as up.
if [ "${DETECT_CLIENT:-yes}" = "yes" ] && \
grep -q "^[ \t]*remote[ \t].*" "${VPNCONF}" ; then
- client=true
+ reenter="yes"
args="${args} --nobind --up-delay --up-restart"
args="${args} --up /etc/openvpn/up.sh"
args="${args} --down-pre --down /etc/openvpn/down.sh"
@@ -104,7 +104,7 @@ start() {
grep -q "^[ \t]*group[ \t].*" "${VPNCONF}" || args="${args} --group openvpn"
fi
- ${client} && mark_service_inactive "${SVCNAME}"
+ [ "${reenter}" = "yes" ] && mark_service_inactive "${SVCNAME}"
start-stop-daemon --start --exec /usr/sbin/openvpn --pidfile "${VPNPID}" \
-- --config "${VPNCONF}" --writepid "${VPNPID}" --daemon ${args}
eend $? "Check your logs to see why startup failed"