diff options
author | Christian Faulhammer <fauli@gentoo.org> | 2010-03-23 22:54:22 +0000 |
---|---|---|
committer | Christian Faulhammer <fauli@gentoo.org> | 2010-03-23 22:54:22 +0000 |
commit | b0061a850365388d097615b8e05543fe8e68f1d2 (patch) | |
tree | 579d3ec4d4f8b29e2a19a0d6df9f73990604f1a0 /net-misc/vpnc | |
parent | version bump (bug #299870) with additions from groepaz@gmx.net via bug #258674 (diff) | |
download | gentoo-2-b0061a850365388d097615b8e05543fe8e68f1d2.tar.gz gentoo-2-b0061a850365388d097615b8e05543fe8e68f1d2.tar.bz2 gentoo-2-b0061a850365388d097615b8e05543fe8e68f1d2.zip |
Fix stop behaviour as reported wiith patch in bug 310687 by Dirk Tilger <dirk AT miriup DOT de>
(Portage version: 2.1.7.17/cvs/Linux i686)
Diffstat (limited to 'net-misc/vpnc')
-rw-r--r-- | net-misc/vpnc/ChangeLog | 11 | ||||
-rw-r--r-- | net-misc/vpnc/files/vpnc-3.init | 102 | ||||
-rw-r--r-- | net-misc/vpnc/vpnc-0.5.3_p449-r1.ebuild (renamed from net-misc/vpnc/vpnc-0.5.3_p449.ebuild) | 6 |
3 files changed, 114 insertions, 5 deletions
diff --git a/net-misc/vpnc/ChangeLog b/net-misc/vpnc/ChangeLog index c9b544f89d12..afe7d8372078 100644 --- a/net-misc/vpnc/ChangeLog +++ b/net-misc/vpnc/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-misc/vpnc -# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/vpnc/ChangeLog,v 1.87 2009/11/10 16:09:20 fauli Exp $ +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/vpnc/ChangeLog,v 1.88 2010/03/23 22:54:22 fauli Exp $ + +*vpnc-0.5.3_p449-r1 (23 Mar 2010) + + 23 Mar 2010; Christian Faulhammer <fauli@gentoo.org> + -vpnc-0.5.3_p449.ebuild, +vpnc-0.5.3_p449-r1.ebuild, +files/vpnc-3.init: + Fix stop behaviour as reported wiith patch in bug 310687 by Dirk Tilger + <dirk AT miriup DOT de> 10 Nov 2009; Christian Faulhammer <fauli@gentoo.org> vpnc-0.5.3_p449.ebuild: diff --git a/net-misc/vpnc/files/vpnc-3.init b/net-misc/vpnc/files/vpnc-3.init new file mode 100644 index 000000000000..61ba36b54ede --- /dev/null +++ b/net-misc/vpnc/files/vpnc-3.init @@ -0,0 +1,102 @@ +#!/sbin/runscript + +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/vpnc/files/vpnc-3.init,v 1.1 2010/03/23 22:54:22 fauli Exp $ + +VPNDIR="/etc/vpnc" +VPN="${SVCNAME#*.}" +if [ -n ${VPN} ] && [ ${SVCNAME} != "vpnc" ]; then + VPNPID="/var/run/vpnc/${VPN}.pid" +else + VPNPID="/var/run/vpnc.pid" +fi +VPNCONF="${VPNDIR}/${VPN}.conf" +VPNSCRIPTDIR="${VPNDIR}/scripts.d" +PREUPSCRIPT="${VPNSCRIPTDIR}/${VPN}-preup.sh" +PREDOWNSCRIPT="${VPNSCRIPTDIR}/${VPN}-predown.sh" +POSTUPSCRIPT="${VPNSCRIPTDIR}/${VPN}-postup.sh" +POSTDOWNSCRIPT="${VPNSCRIPTDIR}/${VPN}-postdown.sh" +# We should source this file to avoid problems when init script +# name differs from the default name +. /etc/conf.d/vpnc + +depend() { + need net + before netmount +} + +checktundevice() { + if [ ! -e /dev/net/tun ]; then + if ! modprobe tun ; then + eerror "TUN/TAP support is not available in this kernel" + return 1 + fi + fi + if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then + ebegin "Detected broken /dev/net/tun symlink, fixing..." + rm -f /dev/net/tun + ln -s /dev/misc/net/tun /dev/net/tun + eend $? + fi +} + +screenoutput() { + if [ "${VPNCOUTPUT}" = "yes" ]; then + export SCREEN_OUTPUT="/dev/stdout" + else + export SCREEN_OUTPUT="/dev/null" + fi +} + +start() { + ebegin "Starting VPNC: ${VPN}" + + checktundevice || return 1 + screenoutput + + if [ ! -e "${VPNCONF}" ]; then + eend 1 "${VPNCONF} does not exist" + return 1 + fi + + local args="" + + if [ -x "${PREUPSCRIPT}" ] ; then + "${PREUPSCRIPT}" > ${SCREEN_OUTPUT} + fi + + start-stop-daemon --start --pidfile "${VPNPID}" --exec /usr/sbin/vpnc \ + -- --pid-file "${VPNPID}" "${VPNCONF}" > ${SCREEN_OUTPUT} + local retval=$? + if [ ! ${retval} -eq 0 ]; then + eend ${retval} + return ${retval} + fi + + if [ -x "${POSTUPSCRIPT}" ] ; then + "${POSTUPSCRIPT}" > ${SCREEN_OUTPUT} + fi + eend $? +} + +stop() { + ebegin "Stopping VPNC: ${VPN}" + screenoutput + if [ -x "${PREDOWNSCRIPT}" ] ; then + "${PREDOWNSCRIPT}" > ${SCREEN_OUTPUT} + fi + + start-stop-daemon --stop --pidfile "${VPNPID}" + local retval=$? + if [ ! ${retval} -eq 0 ]; then + eend ${retval} + return ${retval} + fi + + + if [ -x "${POSTDOWNSCRIPT}" ] ; then + "${POSTDOWNSCRIPT}" > ${SCREEN_OUTPUT} + fi + eend $? +} diff --git a/net-misc/vpnc/vpnc-0.5.3_p449.ebuild b/net-misc/vpnc/vpnc-0.5.3_p449-r1.ebuild index e2d3308eb01c..cf6ee3346206 100644 --- a/net-misc/vpnc/vpnc-0.5.3_p449.ebuild +++ b/net-misc/vpnc/vpnc-0.5.3_p449-r1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/vpnc/vpnc-0.5.3_p449.ebuild,v 1.2 2009/11/10 16:09:20 fauli Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/vpnc/vpnc-0.5.3_p449-r1.ebuild,v 1.1 2010/03/23 22:54:22 fauli Exp $ DESCRIPTION="Free client for Cisco VPN routing software" HOMEPAGE="http://www.unix-ag.uni-kl.de/~massar/vpnc/" @@ -23,7 +23,7 @@ src_install() { dodoc README TODO VERSION || die keepdir /var/run/vpnc keepdir /etc/vpnc/scripts.d - newinitd "${FILESDIR}/vpnc-2.init" vpnc || die + newinitd "${FILESDIR}/vpnc-3.init" vpnc || die newconfd "${FILESDIR}/vpnc.confd" vpnc || die sed -e "s:/usr/local:/usr:" -i "${D}"/etc/vpnc/vpnc-script || die # COPYING file resides here, should not be installed |