summaryrefslogtreecommitdiff
path: root/net-misc/ucarp
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-misc/ucarp
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/ucarp')
-rw-r--r--net-misc/ucarp/Manifest15
-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-r158
-rw-r--r--net-misc/ucarp/files/ucarp.initd-r257
-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.xml8
-rw-r--r--net-misc/ucarp/ucarp-1.5.2-r3.ebuild47
-rw-r--r--net-misc/ucarp/ucarp-1.5.2-r4.ebuild47
-rw-r--r--net-misc/ucarp/ucarp-1.5.2-r5.ebuild47
13 files changed, 485 insertions, 0 deletions
diff --git a/net-misc/ucarp/Manifest b/net-misc/ucarp/Manifest
new file mode 100644
index 000000000000..2644ce2ec670
--- /dev/null
+++ b/net-misc/ucarp/Manifest
@@ -0,0 +1,15 @@
+AUX ucarp.8 6311 SHA256 18a7178c1362d514d8bacb56eb4c89d3987f936397a1dec72376e16179a7fe8b SHA512 4aab5f072663501e90a504e47e30c7cf3a89c6996addb6a23c7d0b3688688141f90d6134c79d2746fef1934a63588723bafb375777b2a12a6715257681baf28f WHIRLPOOL c83a3231dd15cd277c6833c9f7aa871136bbf2b12914c160568df45b8ff8b4b6cf8721672b0df0c52eee687d742730900761fef6b148721465d6a52aef52ebeb
+AUX ucarp.confd 880 SHA256 234ce139aef7b7c24ad7ab7d9901c65e602180bc7bbdba06bb36ffa9379fcfab SHA512 e72594f6292dcc4e17c13c07f12d5cd9ef791ea91ee2c22d5023d0aa574990b6ec6c6714dc45d678ba70ec8395790cd80272a8a57adbd8c735f296e580a298a1 WHIRLPOOL b2b6cdcc7edcc8f73c052e75ce835216b1c06fa2214828a180d20dac7b0189e602f2987c8274e01bf7741b251c17204e3f959c495df535d6eabd2292a5fcb986
+AUX ucarp.initd-r1 1902 SHA256 5597782bc29f2b9f1e9acce81f6e8b18d8fc39fbb28a5e2fde37735e3bf59168 SHA512 6e5a7a1ec245c6c89ce61b189768594a42b630b94d882f79357475a62f63b3198c036f1cdbc09a91b3d3509d6f6b0c621b56f107dbfca76fecf79fae3e0a66db WHIRLPOOL 9c65682981400c2b63abfa436549eebe58d8136443ee2f3d0026897ef07de5246fd73b8102745d088e5ee26d59a7eda38c8e9a344c6942a304312b3679b33bda
+AUX ucarp.initd-r2 1880 SHA256 05e987c6f656ceada35fbd37cfe586d894fedc7de549f17be09eef4c7933eca8 SHA512 cf7dd9bdc148fb737a78701b5b9d2a705048cf4064f3be439e11b8dabd012f6628970461b2fa46e93813e246f200c2672c281e021b987765ba3ebb0fbf78d566 WHIRLPOOL e9a38d54626827cc69a3d84cef0ad44bbd99b6a02b3416bc6cbd3a265ce89a5ff575faf99c469ccacd746767f480c5f2a234d1508eaceb307076da172d72f019
+AUX vip-down-default.sh 119 SHA256 864b62a05eadf0b1bcd097d31803ba019ad5e6e8e3776bd38c56e073ab4b7f00 SHA512 026988d259ab07568995e0609ee0b22245abcf26c65e7c3ddeea8efc801a78eb2796e7423c52731b8070db99e410db4de8217d0a3b7b8681d399fef25c64e56f WHIRLPOOL 1e77c2af43769fbbb0de7f9d5f1baffe9186b635710c9fd59f46b39a36f5926334460942be3e9963c05dc256adbe87fbef6ae26d7705a53850747c9853bab346
+AUX vip-down-default.sh-r1 118 SHA256 7b822d0a641d3da7f108c3f73794d935d1b4670bb6f3056587be375182f7d7c1 SHA512 ddbee9c02601d32f6660b1f769b0cc87595c6417a8ade66f31d0815fa21d54291809f004ee4ce36d097789b6e5f5a0aaba77426bef54c2a824e6af334baf904b WHIRLPOOL 4248fd0d9d7c3efcd9ea2190b1c63a7f8492e6e654536ef89895d293070982b86fa3ba91e943f020c73058808c4c2cbdd85b1579b6c9ea9dde37c7369583b9bf
+AUX vip-up-default.sh 132 SHA256 41cdfdf20f802dcdf7bed9206752d9f232fdc47891ee5103a10a8344131a555f SHA512 4db8a047c39671578d0fa0e0dfadf3ce6e4f5881a85811c5c8e986f26c97b5de64cc58578cd77ba9ee93e2c6659b178c69575d3006934da56736441c30c703ce WHIRLPOOL 0ee0c3d448244ce358a99667b5157d9b567d6a2c947ab5b2bee3eca4534a19be3e1d1c63e0d881026155dbf8b86b0e9a4192274ac28d6f10a0af3f39d42ce365
+AUX vip-up-default.sh-r1 131 SHA256 b448dd2d8e22a1f9bc7ce349abda20a5730c12f9fc8ee659d3d302de09fdfa85 SHA512 d00a2acaa44567f936e029af96a841bf815b75e18f5d2563800e996acdea68ef3265e7ea7b67e7cba3fe671e7809ec905e9cc39ad5fe2c807170cfa1fa6595ff WHIRLPOOL 344292b6c302d4bbee0aa71d975f42661bc319aaf33f6ea82a611a4dd081a7d7ffd09ee1dce3bac9f13d4ad902abff8c5112437d59770c47b1541a50c72507bf
+DIST ucarp-1.5.2.tar.gz 429089 SHA256 f3cc77e28481fd04f62bb3d4bc03104a97dd316c80c0ed04ad7be24b544112f3 SHA512 568ff2061e59d314c72a160ccb42eb099bf7cdf04bc30f405b5b62322dff3ceb4fa037c2b430fdb4cee25f0dcacf9309a15bd814b4b70b640840400bda20b253 WHIRLPOOL b763e7c7023f1364e735baf2df2855bd6bbbbd937267c1a411da22b2ad109b01807f8f7c798662ed0e86f1137a1c8a9ed601eb2a3242a444ba5560d8f47bc285
+EBUILD ucarp-1.5.2-r3.ebuild 1247 SHA256 c5c09a4278ca409ba9b297dddce07752bb687f1d2c265e95d0192803ceac8af8 SHA512 66ab66b2db551c97bee096a2f1d81767c10e6beb96c2268504db219c2b01b4edae118c82ca04c3fa2d153d486673ab108caba5ff43d5168530f9a5a0eea75bc4 WHIRLPOOL aa1d93a022af5ed6d14416b694c8c1eeab37fcac0c4dad4419ac4a04edbf0ec7853fe45f308d1a84cf92a4741f252eb16942b2b3a6bc8280f0ccfa720dfaa7f3
+EBUILD ucarp-1.5.2-r4.ebuild 1294 SHA256 bcac117d3171cf9db2e6a5859448e203f30a56ff714abf8aeefcd865cdbd960e SHA512 e0176e08f11170c9ea5523b2e644eefdf0c2d1178333ed547587407454cfb94e8cfdc287d4b76e7c7ed1fc602d146c707083effdb4b72e03174e5fbbed841261 WHIRLPOOL be0a66fd7cecbe095ee1896374006e118dc7003a1924a19f6e86f177b8f13ce9b27074df088e429c8156aee4cc5984209bc896aac048723fff2d9291c1db491d
+EBUILD ucarp-1.5.2-r5.ebuild 1294 SHA256 a2fdd4d15b11f06a70e0a604cc21fa2df99d5355fca7ae64b2f3443acb3a718f SHA512 0da1ba75ab1b8e877067814e8fb7551f6bdd19c430e6e2a85381ac4e284a642d261c9f41ebb7509ca71737e105b1a24efc06bfb3896c42663759ce99244bbea8 WHIRLPOOL 0abe1fa74c2ac9f72b0b6bc708d051f6fd4422ef462ddf42cf05ea86c78ba3d3a9970adfa634291a6032bc61ff01c5402ce3375ead0188bf0b10841a74653785
+MISC ChangeLog 2999 SHA256 390b4abb1b37154340204802d89756a05d07897a7a02d3c89a6010fb2e7112e7 SHA512 a1f49c92eb851a7d654d98dd9c2bb079761f5c5a723f3ceba55c52a7d2b86e9a0bbd14d2092c36b66e131aa0adb29d76daacc77de78b36140929ba03e5d76e07 WHIRLPOOL 02386119aff7df82d4b360f41826b42e3d72b249be3aecbe28ce82e96764e27a31e8af454ab2b0a7e31aa33825ebedfe38d34671726d6d6f2dad02bfd1df9a39
+MISC ChangeLog-2015 4233 SHA256 ab2429c4e934ffe6970d52e2411d30e5dafce9c2dda44b29f91a2e7082506bf9 SHA512 add16028936d16d6b0529802177ab366ce8f74f95253b7c4fc2671d5005a24cb6cc5f93a7ce0802216fe728865cab72e141360d31651481ed173487ddf47010e WHIRLPOOL 2f8b567988b6c1e6dcd46c9ea7f32355ed5002ab265a62e79a1ccca3de4d896a8e1c0e07c2a870a489f4a6f980679996547f0d1eb0e5608d9fd2cdd4454ff8e4
+MISC metadata.xml 253 SHA256 5030a84d36a522ae62530f6406dbda5099255457f76b3ed419dcffc6d7383667 SHA512 0894860713279dc39bbe7ce3491002710b62c4476198984a0deb6328cb0012c19d7a5546299960bbe600ee240e62a603dd4c4fa04325a753cc0b7c4044c30aba WHIRLPOOL c55ba84102cbd078e50dd719902811669b3913122f44e982c90039b27067446810d881e73a22ed410edc41a409a273fd355be8a6d627bb0e67717b6a33d5fe1e
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..14d84dc01ea4
--- /dev/null
+++ b/net-misc/ucarp/files/ucarp.initd-r1
@@ -0,0 +1,58 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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/ucarp.initd-r2 b/net-misc/ucarp/files/ucarp.initd-r2
new file mode 100644
index 000000000000..cc6537e1226e
--- /dev/null
+++ b/net-misc/ucarp/files/ucarp.initd-r2
@@ -0,0 +1,57 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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-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..4a09d7ba8d61
--- /dev/null
+++ b/net-misc/ucarp/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>cluster@gentoo.org</email>
+ <name>Gentoo Cluster Project</name>
+</maintainer>
+</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..7a09ba18faf4
--- /dev/null
+++ b/net-misc/ucarp/ucarp-1.5.2-r3.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..7fbb7e97c10b
--- /dev/null
+++ b/net-misc/ucarp/ucarp-1.5.2-r4.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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."
+}
diff --git a/net-misc/ucarp/ucarp-1.5.2-r5.ebuild b/net-misc/ucarp/ucarp-1.5.2-r5.ebuild
new file mode 100644
index 000000000000..00283bf58e82
--- /dev/null
+++ b/net-misc/ucarp/ucarp-1.5.2-r5.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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-r2 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."
+}