summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-misc/ucarp
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-misc/ucarp')
-rw-r--r--net-misc/ucarp/Manifest1
-rw-r--r--net-misc/ucarp/files/ucarp.8148
-rw-r--r--net-misc/ucarp/files/ucarp.confd30
-rw-r--r--net-misc/ucarp/files/ucarp.initd-r159
-rw-r--r--net-misc/ucarp/files/vip-down-default.sh7
-rw-r--r--net-misc/ucarp/files/vip-down-default.sh-r17
-rw-r--r--net-misc/ucarp/files/vip-up-default.sh7
-rw-r--r--net-misc/ucarp/files/vip-up-default.sh-r17
-rw-r--r--net-misc/ucarp/metadata.xml5
-rw-r--r--net-misc/ucarp/ucarp-1.5.2-r3.ebuild48
-rw-r--r--net-misc/ucarp/ucarp-1.5.2-r4.ebuild48
11 files changed, 367 insertions, 0 deletions
diff --git a/net-misc/ucarp/Manifest b/net-misc/ucarp/Manifest
new file mode 100644
index 000000000000..abd697c6fcd1
--- /dev/null
+++ b/net-misc/ucarp/Manifest
@@ -0,0 +1 @@
+DIST ucarp-1.5.2.tar.gz 429089 SHA256 f3cc77e28481fd04f62bb3d4bc03104a97dd316c80c0ed04ad7be24b544112f3 SHA512 568ff2061e59d314c72a160ccb42eb099bf7cdf04bc30f405b5b62322dff3ceb4fa037c2b430fdb4cee25f0dcacf9309a15bd814b4b70b640840400bda20b253 WHIRLPOOL b763e7c7023f1364e735baf2df2855bd6bbbbd937267c1a411da22b2ad109b01807f8f7c798662ed0e86f1137a1c8a9ed601eb2a3242a444ba5560d8f47bc285
diff --git a/net-misc/ucarp/files/ucarp.8 b/net-misc/ucarp/files/ucarp.8
new file mode 100644
index 000000000000..756c5e6eca8a
--- /dev/null
+++ b/net-misc/ucarp/files/ucarp.8
@@ -0,0 +1,148 @@
+.TH "UCARP" "8"
+.SH "NAME"
+ucarp \(em Automatic IP failover
+.SH "SYNOPSIS"
+.PP
+\fBucarp\fR [\fB-i, \-\-interface=\fIINTERFACE\fR\fP] [\fB-s, \-\-srcip=\fIIPADDRESS\fR\fP]
+.br
+[\fB-v, \-\-vhid=\fIVHID\fR\fP] [\fB-p, \-\-pass=\fIPASSWORD\fR\fP] [\fB-o, \-\-passfile=\fIPASSFILE\fR\fP]
+.br
+[\fB-P, \-\-preempt\fP] [\fB-n, \-\-neutral\fP] [\fB-a, \-\-addr=\fIIPADDR\fR\fP] [\fB-h, \-\-help\fP]
+.br
+[\fB-b, \-\-advbase=\fISECS\fR\fP] [\fB-k, \-\-advskew=\fISKEW\fR\fP] [\fB-u, \-\-upscript=\fISCRIPT\fR\fP]
+.br
+[\fB-d, \-\-downscript=\fISCRIPT\fR\fP] [\fB-r, \-\-deadratio=\fIRATIO\fR\fP] [\fB-z, \-\-shutdown\fP]
+.br
+[\fB-B, \-\-daemonize\fP] [\fB-f, \-\-facility=\fIFACILITY\fR\fP] [\fB-x, \-\-xparam \fIPARAM\fR\fP]
+.br
+[\fB-S, \-\-ignoreifstate\fP] [\fB-M, \-\-nomcast\fP]
+.SH "DESCRIPTION"
+.PP
+ucarp allows a pair of hosts to share common IP addresses in
+order to provide automatic failover of an address from one machine to
+another. It is a portable userland implementation of the secure and
+patent-free Common Address Redundancy Protocol, (CARP), OpenBSD's
+alternative to VRRP.
+.SH "OPTIONS"
+.PP
+ucarp supports the following command line options:
+.IP "\fB-i \fIINTERFACE\fR\fP\fB \-\-interface=\fIINTERFACE\fR\fP" 10
+The network interface to bind to.
+.IP "\fB-s \fIIPADDRESS\fR\fP\fB \-\-srcip=\fIIPADDRESS\fR\fP" 10
+The persistent source address, (real IP), associated with this
+interface.
+.IP "\fB-v \fIVHID\fR\fP\fB \-\-vhid=\fIVHID\fR\fP" 10
+The id of the virtual server [1-255].
+.IP "\fB-p \fIPASSWORD\fR\fP\fB \-\-pass=\fIPASSWORD\fR\fP" 10
+The shared password, (this gets encrypted and is not sent in the
+clear).
+.IP "\fB-o \fIPASSFILE\fR\fP\fB \-\-passfile=\fIPASSFILE\fR\fP" 10
+File to read the shared password from. The file specified
+should contain the password on the first line of the file.
+.IP "\fB-P \fP\fB\-\-preempt\fP" 10
+Turn on preemptive failover. This causes an instance of
+ucarp to assume master status right immediately.
+.IP "\fB-n \fP\fB\-\-neutral\fP" 10
+Do not run the downscript on startup when the
+initial state is backup.
+.IP "\fB-a \fIIPADDRESS\fR\fP\fB \-\-addr=\fIIPADDRESS\fR\fP" 10
+The IP address of the virtual server.
+.IP "\fB-h \fP\fB\-\-help\fP" 10
+Display a brief summary of the command line options.
+.IP "\fB-b \fISECONDS\fR\fP\fB \-\-advbase=\fISECONDS\fR\fP" 10
+Interval in seconds that advertisements will occur, (defaults
+to 1 second).
+.IP "\fB-k \fISKEW\fR\fP\fB \-\-advskew=\fISKEW\fR\fP" 10
+Advertisement skew [1-255], (defaults to 0).
+.IP "\fB-u \fICOMMAND\fR\fP\fB \-\-upscript=\fICOMMAND\fR\fP" 10
+Specifies the command to run after ucarp has successfully
+become master, the interface name gets passed as an argument.
+Typically a script used to bring up the virtual address, log the
+result, add routes, clear arp cache entries, etc.
+.IP "\fB-d \fICOMMAND\fR\fP\fB \-\-downscript=\fICOMMAND\fR\fP" 10
+Specifies the command that is run after ucarp has
+transitioned to the backup state, the interface name is passed
+as an argument. This is typically a script used to bring down
+the virtual interface, log the action, remove routes, etc.
+.IP "\fB-r \fIRATIO\fR\fP\fB \-\-deadratio=\fIRATIO\fR\fP" 10
+Ratio used by the backup to determine how long to wait for an
+unresponsive master before considering it dead.
+.IP "\fB-z\fP\fB \-\-shutdown\fP" 10
+Use of this command causes the command specified by the \-d
+argument to be invoked when ucarp shuts down.
+.IP "\fB-B\fP\fB \-\-daemonize\fP" 10
+Causes ucarp to detach from the terminal and run in the
+background as a daemon.
+.IP "\fB-f\fP\fB \-\-facility\fP" 10
+Set the syslog facility, defaults to daemon.
+.IP "\fB-x \fIPARAMETER\fR\fP\fB \-\-xparam=\fIPARAMETER\fR\fP" 10
+Specify an extra parameter to be supplied to the up/down
+scripts.
+.IP "\fB-S\fP\fB \-\-ignoreifstate\fP" 10
+Ignore unplugged network cables. This option is useful when
+ucarp nodes are connected with a crossover cable. Without
+this option the master will transition to backup when the other
+node is powered down, as it no longer has a link (NO-CARRIER).
+
+.IP "\fB-M\fP\fB \-\-nomcast\fP" 10
+Use broadcast instead of multicast advertisements.
+.SH "EXAMPLES"
+.PP
+A host with a real IP of 10.1.1.10 configured to be the master
+in a preemptive configuration with a virtual IP of 10.1.1.252.
+.PP
+.nf
+\fB \fPucarp \-i eth0 \-s 10.1.1.10 \-v 10 \-p secret \-a 10.1.1.252 \\
+\fB \fP\-\-upscript=/etc/vip-up.sh \-\-downscript=/etc/vip-down.sh \-P
+.fi
+.PP
+The backup might be configured something like this.
+.PP
+.nf
+\fB \fPucarp \-i eth0 \-s 10.1.1.11 \-v 10 \-p secret \-a 10.1.1.252 \\
+\fB \fP\-\-upscript=/etc/vip-up.sh \-\-downscript=/etc/vip-down.sh
+.fi
+.PP
+A machine with a real IP of 192.168.1.19 is the preferred master for
+a virtual IP of 10.1.12.7, broadcasts are sent every 5 seconds.
+.PP
+.nf
+\fB \fPucarp \-b 5 \-s 192.168.1.19 \-v 27 \-p badpass \-a 10.1.12.7 \\
+\fB \fP-u /etc/vip-up.sh \-d /etc/vip-down.sh \-z
+.fi
+.PP
+The hot standby with an IP of 192.168.1.20 uses the following
+command, (note the advskew of 50 putting it at a disadvantage and making
+the first machine preferred).
+.PP
+.nf
+\fB \fPucarp \-b 5 \-k 50 \-s 192.168.1.20 \-v 27 \-p badpass \-a 10.1.12.7 \\
+\fB \fP-u /etc/vip-up.sh \-d /etc/vip-down.sh \-z
+.fi
+.SH "SIGNALS"
+.PP
+Sending the ucarp process a SIGUSR1 will have it log a status
+line to syslog, eg "Sep 13 12:59:56 localhost ucarp[2654]: [INFO]
+MASTER on eth0 id 1" or "Sep 13 13:00:25 localhost ucarp[2644]: [INFO]
+BACKUP on eth0 id 1"
+.PP
+Sending the ucarp process a SIGUSR2 will cause it to demote itself
+from master to backup, pause 3 seconds, then proceed as usual to listen
+for other masters, and promote itself if necessary. This could be useful
+if you wish another node to take over master.
+
+.SH "AUTHOR"
+.PP
+ucarp was written by Frank Denis, <j@ucarp.org>.
+.PP
+This manual page was written by Eric Evans <eevans@debian.org>
+for the \fBDebian\fP system (but may be used by others). Permission is
+granted to copy, distribute and/or modify this document under
+the terms of the GNU General Public License, Version 2 or any
+later version published by the Free Software Foundation.
+
+.PP
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL.
+
+.\" created by instant / docbook-to-man, Wed 10 Aug 2011, 17:40 \ No newline at end of file
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-r1 b/net-misc/ucarp/files/ucarp.initd-r1
new file mode 100644
index 000000000000..5b4d214d04d2
--- /dev/null
+++ b/net-misc/ucarp/files/ucarp.initd-r1
@@ -0,0 +1,59 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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
+ provide ucarp
+}
+
+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-down-default.sh-r1 b/net-misc/ucarp/files/vip-down-default.sh-r1
new file mode 100644
index 000000000000..5e1862b3a14b
--- /dev/null
+++ b/net-misc/ucarp/files/vip-down-default.sh-r1
@@ -0,0 +1,7 @@
+#! /bin/sh
+exec 2> /dev/null
+
+/bin/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/files/vip-up-default.sh-r1 b/net-misc/ucarp/files/vip-up-default.sh-r1
new file mode 100644
index 000000000000..4b44dafde734
--- /dev/null
+++ b/net-misc/ucarp/files/vip-up-default.sh-r1
@@ -0,0 +1,7 @@
+#! /bin/sh
+exec 2> /dev/null
+
+/bin/ip addr add "$2"/"$3" dev "$1"
+
+# or alternatively:
+# /sbin/ifconfig "$1":254 "$2" netmask "$3"
diff --git a/net-misc/ucarp/metadata.xml b/net-misc/ucarp/metadata.xml
new file mode 100644
index 000000000000..348e6c4de815
--- /dev/null
+++ b/net-misc/ucarp/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>cluster</herd>
+</pkgmetadata>
diff --git a/net-misc/ucarp/ucarp-1.5.2-r3.ebuild b/net-misc/ucarp/ucarp-1.5.2-r3.ebuild
new file mode 100644
index 000000000000..8e87f6b51a57
--- /dev/null
+++ b/net-misc/ucarp/ucarp-1.5.2-r3.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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-r1 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."
+}
diff --git a/net-misc/ucarp/ucarp-1.5.2-r4.ebuild b/net-misc/ucarp/ucarp-1.5.2-r4.ebuild
new file mode 100644
index 000000000000..0f9ec17729d8
--- /dev/null
+++ b/net-misc/ucarp/ucarp-1.5.2-r4.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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
+ newexe "${FILESDIR}"/vip-up-default.sh-r1 vip-up-default.sh
+ newexe "${FILESDIR}"/vip-down-default.sh-r1 vip-down-default.sh
+
+ keepdir /etc/ucarp
+
+ newinitd "${FILESDIR}"/ucarp.initd-r1 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."
+}