summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2016-08-22 20:19:23 +0200
committerPatrick Lauer <patrick@gentoo.org>2016-08-22 20:19:23 +0200
commit999b5c7443c9cfcaf7477769a18c7dc60e6b3a27 (patch)
treeda021bbdd98b25d8f8fcdac42d54d987b6df19a3 /net-misc/ucarp
parentnet-libs/zeromq: Remove old (diff)
downloadgentoo-999b5c7443c9cfcaf7477769a18c7dc60e6b3a27.tar.gz
gentoo-999b5c7443c9cfcaf7477769a18c7dc60e6b3a27.tar.bz2
gentoo-999b5c7443c9cfcaf7477769a18c7dc60e6b3a27.zip
net-misc/ucarp: Remove unneeded provide from init script
Package-Manager: portage-2.3.0
Diffstat (limited to 'net-misc/ucarp')
-rw-r--r--net-misc/ucarp/files/ucarp.initd-r258
-rw-r--r--net-misc/ucarp/ucarp-1.5.2-r5.ebuild48
2 files changed, 106 insertions, 0 deletions
diff --git a/net-misc/ucarp/files/ucarp.initd-r2 b/net-misc/ucarp/files/ucarp.initd-r2
new file mode 100644
index 000000000000..a9747e9fd3da
--- /dev/null
+++ b/net-misc/ucarp/files/ucarp.initd-r2
@@ -0,0 +1,58 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 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
+}
+
+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/ucarp-1.5.2-r5.ebuild b/net-misc/ucarp/ucarp-1.5.2-r5.ebuild
new file mode 100644
index 000000000000..4af200c66169
--- /dev/null
+++ b/net-misc/ucarp/ucarp-1.5.2-r5.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2016 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-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."
+}