summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2013-03-11 10:45:02 +0000
committerTiziano Müller <dev-zero@gentoo.org>2013-03-11 10:45:02 +0000
commit9818e785c9003ec6004cba979bd91b67711ea39c (patch)
tree37c24316de7a375bbe2254097bc9db02eb8dd071 /net-misc/ucarp
parentleave to dotnet (diff)
downloadgentoo-2-9818e785c9003ec6004cba979bd91b67711ea39c.tar.gz
gentoo-2-9818e785c9003ec6004cba979bd91b67711ea39c.tar.bz2
gentoo-2-9818e785c9003ec6004cba979bd91b67711ea39c.zip
Revision bump for new init.d/conf.d-scripts written from scratch by Christian Affolter for the FOSS-Cloud project, fixes bug #208156.
(Portage version: 2.1.11.54/cvs/Linux x86_64, signed Manifest commit with key 0x1E0CA85F!)
Diffstat (limited to 'net-misc/ucarp')
-rw-r--r--net-misc/ucarp/ChangeLog12
-rw-r--r--net-misc/ucarp/files/ucarp.confd30
-rw-r--r--net-misc/ucarp/files/ucarp.initd58
-rw-r--r--net-misc/ucarp/files/vip-down-default.sh7
-rw-r--r--net-misc/ucarp/files/vip-up-default.sh7
-rw-r--r--net-misc/ucarp/ucarp-1.5.2-r2.ebuild48
6 files changed, 160 insertions, 2 deletions
diff --git a/net-misc/ucarp/ChangeLog b/net-misc/ucarp/ChangeLog
index 6d3f4d53563b..744b6aa431b2 100644
--- a/net-misc/ucarp/ChangeLog
+++ b/net-misc/ucarp/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-misc/ucarp
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/ucarp/ChangeLog,v 1.20 2012/12/16 13:47:24 ago Exp $
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ucarp/ChangeLog,v 1.21 2013/03/11 10:45:02 dev-zero Exp $
+
+*ucarp-1.5.2-r2 (11 Mar 2013)
+
+ 11 Mar 2013; Tiziano Müller <dev-zero@gentoo.org> +files/ucarp.confd,
+ +files/ucarp.initd, +files/vip-down-default.sh, +files/vip-up-default.sh,
+ +ucarp-1.5.2-r2.ebuild:
+ Revision bump for new init.d/conf.d-scripts written from scratch by Christian
+ Affolter for the FOSS-Cloud project, fixes bug #208156.
16 Dec 2012; Agostino Sarubbo <ago@gentoo.org> ucarp-1.5.2-r1.ebuild:
Stable for x86, wrt bug #441486
diff --git a/net-misc/ucarp/files/ucarp.confd b/net-misc/ucarp/files/ucarp.confd
new file mode 100644
index 000000000000..1a8cdb156973
--- /dev/null
+++ b/net-misc/ucarp/files/ucarp.confd
@@ -0,0 +1,30 @@
+# /etc/conf.d/ucarp: config file for /etc/init.d/ucarp
+
+# The network interface to bind to, for example 'eth0'
+UCARP_INTERFACE=
+
+# The persistent source address, (real IP), associated with this interface.
+UCARP_SOURCEADDRESS=
+
+# The IP address of the virtual server.
+UCARP_VIRTUALADDRESS=
+
+# The prefix length of the virtual server IP address
+# For example 24 for a netmask of 255.255.255.0
+UCARP_VIRTUALPREFIX=
+
+# The id of the virtual server [1-255].
+UCARP_VHID=123
+
+# File to read the shared password from.
+UCARP_PASSFILE=/etc/ucarp/ucarp.pass
+
+# Specifies the command to run after ucarp has successfully become master.
+UCARP_UPSCRIPT=/usr/libexec/ucarp/vip-up-default.sh
+
+# Specifies the command that is run after ucarp has transitioned to the backup
+# state.
+UCARP_DOWNSCRIPT=/usr/libexec/ucarp/vip-down-default.sh
+
+# Additional ucarp options to pass
+UCARP_OPTS="--shutdown"
diff --git a/net-misc/ucarp/files/ucarp.initd b/net-misc/ucarp/files/ucarp.initd
new file mode 100644
index 000000000000..0ca86e408130
--- /dev/null
+++ b/net-misc/ucarp/files/ucarp.initd
@@ -0,0 +1,58 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ucarp/files/ucarp.initd,v 1.1 2013/03/11 10:45:02 dev-zero Exp $
+
+description="UCARP is a portable implementation of the CARP protocol"
+description_logstatus="Logs the status of ${SVCNAME} to syslog"
+description_demote="Demotes ${SVCNAME} from master to backup"
+
+extra_started_commands="logstatus demote"
+
+command="/usr/sbin/ucarp"
+command_args="--interface=${UCARP_INTERFACE} \
+ --srcip=${UCARP_SOURCEADDRESS} \
+ --vhid=${UCARP_VHID} \
+ --passfile=${UCARP_PASSFILE} \
+ --addr=${UCARP_VIRTUALADDRESS} \
+ --upscript=${UCARP_UPSCRIPT} \
+ --downscript=${UCARP_DOWNSCRIPT} \
+ --xparam=${UCARP_VIRTUALPREFIX} \
+ ${UCARP_OPTS}"
+
+pidfile="/var/run/${SVCNAME}.pid"
+command_background="yes"
+
+required_files="${UCARP_PASSFILE} ${UCARP_UPSCRIPT} ${UCARP_DOWNSCRIPT}"
+
+depend() {
+ need net
+ use logger
+}
+
+start_pre() {
+ local required_vars='UCARP_INTERFACE UCARP_SOURCEADDRESS UCARP_VHID
+ UCARP_PASSFILE UCARP_VIRTUALADDRESS UCARP_UPSCRIPT
+ UCARP_DOWNSCRIPT UCARP_VIRTUALPREFIX'
+
+ local config_var=''
+ for config_var in $required_vars; do
+ if test -z "$(eval echo \$$config_var)"; then
+ eerror "Missing or empty config variable '$config_var'"
+ ewarn "You have to edit /etc/conf.d/${SVCNAME} first"
+ return 1
+ fi
+ done
+}
+
+logstatus() {
+ ebegin "Logging status of ${SVCNAME} to syslog"
+ start-stop-daemon --signal SIGUSR1 --pidfile "${pidfile}"
+ eend $?
+}
+
+demote() {
+ ebegin "Demote ${SVCNAME} from master to backup"
+ start-stop-daemon --signal SIGUSR2 --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/net-misc/ucarp/files/vip-down-default.sh b/net-misc/ucarp/files/vip-down-default.sh
new file mode 100644
index 000000000000..cf5bfe5ce3a1
--- /dev/null
+++ b/net-misc/ucarp/files/vip-down-default.sh
@@ -0,0 +1,7 @@
+#! /bin/sh
+exec 2> /dev/null
+
+/sbin/ip addr del "$2"/"$3" dev "$1"
+
+# or alternatively:
+# /sbin/ifconfig "$1":254 down
diff --git a/net-misc/ucarp/files/vip-up-default.sh b/net-misc/ucarp/files/vip-up-default.sh
new file mode 100644
index 000000000000..763a56170a85
--- /dev/null
+++ b/net-misc/ucarp/files/vip-up-default.sh
@@ -0,0 +1,7 @@
+#! /bin/sh
+exec 2> /dev/null
+
+/sbin/ip addr add "$2"/"$3" dev "$1"
+
+# or alternatively:
+# /sbin/ifconfig "$1":254 "$2" netmask "$3"
diff --git a/net-misc/ucarp/ucarp-1.5.2-r2.ebuild b/net-misc/ucarp/ucarp-1.5.2-r2.ebuild
new file mode 100644
index 000000000000..6aced2e323c6
--- /dev/null
+++ b/net-misc/ucarp/ucarp-1.5.2-r2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ucarp/ucarp-1.5.2-r2.ebuild,v 1.1 2013/03/11 10:45:02 dev-zero Exp $
+
+EAPI="5"
+
+DESCRIPTION="Portable userland implementation of Common Address Redundancy Protocol (CARP)."
+HOMEPAGE="http://www.ucarp.org"
+SRC_URI="ftp://ftp.ucarp.org/pub/ucarp/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="nls"
+
+RDEPEND="net-libs/libpcap"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_configure() {
+ econf $(use_enable nls)
+}
+
+src_install() {
+ default
+
+ doman "${FILESDIR}"/ucarp.8
+
+ exeinto /usr/libexec/ucarp
+ doexe "${FILESDIR}"/vip-up-default.sh
+ doexe "${FILESDIR}"/vip-down-default.sh
+
+ keepdir /etc/ucarp
+
+ newinitd "${FILESDIR}"/ucarp.initd ucarp
+ newconfd "${FILESDIR}"/ucarp.confd ucarp
+}
+
+pkg_postinst() {
+ elog "The provided init script needs to be configured first."
+ elog "Edit /etc/conf.d/ucarp to suite your environment."
+ elog "You will also have to set a shared password within /etc/ucarp/ucarp.pass"
+ elog "or whatever file you have set \$UCARP_PASSFILE to."
+
+ elog "If you need more than one instance of ucarp running, simply symlink"
+ elog "the init script and create a copy of the init script configuration"
+ elog "which corresponds to the name of the init script."
+}