From 9dc59875c0dca1d1f4555ba93e230e2bcfdc94e4 Mon Sep 17 00:00:00 2001 From: Warren Togami Date: Mon, 26 Feb 2007 19:29:12 +0000 Subject: [PATCH 01/16] Initialize branch EL-5 for ucarp --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..42f697a --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-5 From f3126540ec8f39b7abc9ecbdab0353a34248a77d Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Wed, 8 Jul 2009 17:41:06 +0000 Subject: [PATCH 02/16] 1.1 and 1.3 were never build, updating to 1.5 and building, BZ 510287. --- sources | 2 +- ucarp.init | 71 ++++++++++++++++++++++++-------------------- ucarp.spec | 51 ++++++++++++++++++++----------- vip-001.conf.example | 45 +++------------------------- vip-common.conf | 8 +++++ vip-down | 25 ++-------------- vip-up | 25 ++-------------- 7 files changed, 90 insertions(+), 137 deletions(-) create mode 100644 vip-common.conf diff --git a/sources b/sources index f77f191..5c48d2b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bed7ae84520f2e0faf3e68e9cfe4e1aa ucarp-1.2.tar.bz2 +5b50ca5553bc520f4e639964c9ad5056 ucarp-1.5.tar.bz2 diff --git a/ucarp.init b/ucarp.init index 2512226..c7f6296 100755 --- a/ucarp.init +++ b/ucarp.init @@ -4,6 +4,16 @@ # chkconfig: - 91 09 # description: Starts and stops the common address redundancy protocol daemon +### BEGIN INIT INFO +# Provides: lsb-ucarp +# Required-Start: $local_fs $network $remote_fs +# Required-Stop: $local_fs $network $remote_fs +# Default-Start: +# Default-Stop: 0 1 6 +# Short-Description: start and stop ucarp +# Description: Common Address Redundancy Protocol (CARP) for Unix +### END INIT INFO + # Source function library. . /etc/init.d/functions @@ -19,11 +29,10 @@ get_files() { } prog=$"common address redundancy protocol daemon" -OUR_INITLOG_ARGS="-n ucarp -e 2 -s" -OUR_INITLOG="initlog ${OUR_INITLOG_ARGS}" +LOGGER="/usr/bin/logger -p daemon.notice -t ucarp" CONFDIR=/etc/ucarp -UPSCRIPT=${CONFDIR}/vip-up -DOWNSCRIPT=${CONFDIR}/vip-down +UPSCRIPT=/usr/libexec/ucarp/vip-up +DOWNSCRIPT=/usr/libexec/ucarp/vip-down start() { RETVAL=-1 @@ -34,32 +43,38 @@ start() { get_files if [ -z "${FILES}" ]; then - failure $"no virtual addresses are configured in ${CONFDIR}:" + ${LOGGER} "no virtual addresses are configured in ${CONFDIR}" + failure RETVAL=1 else for FILE in ${FILES}; do # Check that the file name gives us an ID between 1 and 255 ID=`echo ${FILE}| sed 's/^vip-\(.*\).conf/\1/'` if [ ${ID} -lt 1 -o ${ID} -gt 255 ]; then - ${OUR_INITLOG} $"ID out of range (1-255) for ${FILE}, skipped VIP ID ${ID}:" + ${LOGGER} "ID out of range (1-255) for ${FILE}, skipped VIP ID ${ID}" continue fi - unset PASSWORD BIND_INTERFACE BIND_ADDRESS VIP OPTIONS + unset PASSWORD BIND_INTERFACE SOURCE_ADDRESS VIP_ADDRESS OPTIONS # Source ucarp settings + . ${CONFDIR}/vip-common.conf . ${CONFDIR}/${FILE} TMP_RETVAL=0 if [ -z "${PASSWORD}" ]; then - ${OUR_INITLOG} $"no PASSWORD found in ${FILE}, skipped VIP ID ${ID}:" + ${LOGGER} "no PASSWORD found for ${FILE}, skipped VIP ID ${ID}" TMP_RETVAL=1 fi - if [ -z "${BIND_ADDRESS}" ]; then - ${OUR_INITLOG} $"no BIND_ADDRESS found in ${FILE}, skipped VIP ID ${ID}:" + if [ -z "${BIND_INTERFACE}" ]; then + ${LOGGER} "no BIND_INTERFACE found for ${FILE}, skipped VIP ID ${ID}" + TMP_RETVAL=1 + fi + if [ -z "${SOURCE_ADDRESS}" ]; then + ${LOGGER} "no SOURCE_ADDRESS found for ${FILE}, skipped VIP ID ${ID}" TMP_RETVAL=1 fi if [ -z "${VIP_ADDRESS}" ]; then - ${OUR_INITLOG} $"no VIP_ADDRESS found in ${FILE}, skipped VIP ID ${ID}:" + ${LOGGER} "no VIP_ADDRESS found for ${FILE}, skipped VIP ID ${ID}" TMP_RETVAL=1 fi @@ -70,19 +85,22 @@ start() { fi [ ${RETVAL} -eq -1 ] && RETVAL=0 - daemon /usr/sbin/ucarp -v ${ID} -m ${ID} -p ${PASSWORD} -s ${BIND_ADDRESS} -a ${VIP_ADDRESS} -i ${BIND_INTERFACE} ${OPTIONS} -B --upscript=$UPSCRIPT --downscript=$DOWNSCRIPT >/dev/null + daemon /usr/sbin/ucarp --daemonize --interface=${BIND_INTERFACE} --pass=${PASSWORD} --srcip=${SOURCE_ADDRESS} --vhid=${ID} --addr=${VIP_ADDRESS} ${OPTIONS} --upscript=$UPSCRIPT --downscript=$DOWNSCRIPT >/dev/null LAUNCH_RETVAL=$? [ ${LAUNCH_RETVAL} -ne 0 ] && RETVAL=1 done # failure/success or warning if launch worked with some vip errors if [ ${RETVAL} -eq 0 -a ${VIP_RETVAL} -eq 0 ]; then - success $"all ucarp configurations were applied successfully:" + ${LOGGER} "all ucarp configurations were applied successfully" + success touch /var/lock/subsys/ucarp elif [ ${RETVAL} -eq 0 -a ${VIP_RETVAL} -eq 1 ]; then - warning $"error in one or more of the ucarp configurations:" + ${LOGGER} "error in one or more of the ucarp configurations" + warning else - failure $"error running one or more of the ucarp daemon instances:" + ${LOGGER} "error running one or more of the ucarp daemon instances" + failure fi fi echo @@ -93,27 +111,16 @@ stop() { killproc /usr/sbin/ucarp >/dev/null RETVAL=$? - # We unassign all UCARP-managed VIPs when stopping the service - # to avoid conflicting "leftovers". - - get_files - - [ ! -z "${FILES}" ] && \ - for FILE in ${FILES}; do - ID=`echo ${FILE}| sed 's/^vip-\(.*\).conf/\1/'` - unset PASSWORD BIND_INTERFACE BIND_ADDRESS VIP OPTIONS - # Source ucarp settings - . ${CONFDIR}/${FILE} - $DOWNSCRIPT $BIND_INTERFACE $VIP_ADDRESS ${ID} &>/dev/null - #TMP_RETVAL=$? - #[ ${TMP_RETVAL} -ne 0 ] && VIP_RETVAL=1 - done + # With "--shutdown" in the default OPTIONS, the down script is called + # when ucarp is stopped, so IP addresses are released, no "leftovers". # failure/success (no warning, too complicated to handle properly) if [ ${RETVAL} -eq 1 ]; then - failure $"it seems like no ucarp daemon were running:" + ${LOGGER} "it seems like no ucarp daemon were running" + failure else - success $"all ucarp daemons stopped and IP addresses unassigned:" + ${LOGGER} "all ucarp daemons stopped and IP addresses unassigned" + success rm -f /var/lock/subsys/ucarp fi echo diff --git a/ucarp.spec b/ucarp.spec index 22a38c1..0da0a6f 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,18 +1,18 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp -Version: 1.2 -Release: 7%{?dist} -License: BSD +Version: 1.5 +Release: 1%{?dist} +# See the COPYING file which details everything +License: MIT and BSD Group: System Environment/Daemons URL: http://www.ucarp.org/ Source0: http://download.pureftpd.org/pub/ucarp/ucarp-%{version}.tar.bz2 Source1: ucarp.init Source2: vip-001.conf.example -Source3: vip-001.list.example +Source3: vip-common.conf Source4: vip-up Source5: vip-down -Source6: vip-helper.sh -Patch0: ucarp-1.3-pre.patch +#Source6: vip-helper.sh BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig, /sbin/service @@ -32,8 +32,7 @@ need for any dedicated extra network link between redundant hosts. %prep -%setup -%patch -p1 +%setup -q %build @@ -51,14 +50,15 @@ need for any dedicated extra network link between redundant hosts. %{buildroot}/etc/rc.d/init.d/ucarp %{__mkdir_p} %{buildroot}/etc/ucarp +%{__mkdir_p} %{buildroot}%{_libexecdir}/ucarp # Install the example config files %{__install} -D -p -m 0600 %{SOURCE2} %{SOURCE3} \ %{buildroot}/etc/ucarp/ # Install helper scripts -%{__install} -D -p -m 0700 %{SOURCE4} %{SOURCE5} %{SOURCE6} \ - %{buildroot}/etc/ucarp/ +%{__install} -D -p -m 0700 %{SOURCE4} %{SOURCE5} \ + %{buildroot}%{_libexecdir}/ucarp/ %clean @@ -88,19 +88,36 @@ fi %files -f %{name}.lang -%defattr(-, root, root, 0755) +%defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog NEWS README /etc/rc.d/init.d/ucarp -%attr(0700, root, root) %dir /etc/ucarp/ +%attr(0700,root,root) %dir /etc/ucarp/ +%config(noreplace) /etc/ucarp/vip-common.conf /etc/ucarp/vip-001.conf.example -/etc/ucarp/vip-001.list.example -/etc/ucarp/vip-up -/etc/ucarp/vip-down -/etc/ucarp/vip-helper.sh +%{_libexecdir}/ucarp/ %{_sbindir}/ucarp - %changelog +* Mon Apr 13 2009 Jon Ciesla - 1.5-1 +- Update to 1.5 BZ 458767. +- Added LSB header to init script, BZ 247082. +- New upstream should address BZ 427495, 449266, 455394. + +* Wed Feb 25 2009 Fedora Release Engineering - 1.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sun Feb 3 2008 Matthias Saou 1.4-1 +- Update to 1.4. +- Rip out all of the "list" stuff and 255.255.255.255 address hack (#427495). +- Change from INITLOG (now deprecated) to LOGGER in the init script. +- Move helper scripts to /usr/libexec/ucarp/. + +* Thu Aug 23 2007 Matthias Saou 1.2-9 +- Rebuild for new BuildID feature. + +* Sun Aug 5 2007 Matthias Saou 1.2-8 +- Update License field. + * Fri Feb 2 2007 Matthias Saou 1.2-7 - Rename service from carp to ucarp, to be more consistent. - Move /etc/sysconfig/carp to /etc/ucarp since it has become a config directory diff --git a/vip-001.conf.example b/vip-001.conf.example index cbfbf83..0bbc5ba 100644 --- a/vip-001.conf.example +++ b/vip-001.conf.example @@ -1,47 +1,10 @@ # Virtual IP configuration file for UCARP # The number (from 001 to 255) in the name of the file is the identifier -# $Id: vip-001.conf.example,v 1.3 2006/11/29 12:00:11 thias Exp $ - -# Set the same password on all machines sharing the same virtual router ID. -PASSWORD="love" - -# UCARP daemon by default uses the first PCAP-capable interface as returned by -# pcap_lookupdev(), this is often "eth0". This option allows you to change -# this behaviour. -BIND_INTERFACE="eth0" - -# This is a mandatory option. UCARP daemon will use this IP address for its -# announces regardless of the addresses actually assigned to the interface. -#BIND_ADDRESS="10.0.0.2" - -# There is a simple and an advanced way to configure UCARP. In both ways you -# have two physical routers with distinct IP addresses on the same IP network. # In the simple scenario, you want a single virtual IP address from the _same_ -# network to be taken over by one of the routers. You configure this VIP right -# here then: -#VIP_ADDRESS="10.10.10.10" +# network to be taken over by one of the routers. +VIP_ADDRESS="10.0.0.254" -# In the complex scenario, your virtual router consists of more than one IP -# address. For example, you might want to assign to the virtual router not only -# the address which is used as the default gateway on the LAN, but also the only -# real IP address, which you got from your ISP. Your configuration would have -# two steps then: -# 1. Configure the VIP_ADDRESS to "255.255.255.255" -# 2. Create a file in the same directory which holds vip-XXX.conf, with a name -# vip-XXX.list. For example, if the .conf file is named vip-001.conf, the .list -# file would be vip-001.list. Each meaningful line of this file will be used as -# an argument for "ip address add" and "ip address del" commands. This way you -# can control, which IP addresses will be assigned to which interfaces. -#VIP_ADDRESS="255.255.255.255" +# In more complex scenarios, check the "vip-common" file for values to override +# and how to add options. -# If you have extra options to add, see "ucarp --help" output -# (the lower the "-k " the higher priority and "-P" to become master ASAP) -# Please note you can use only the following options here: -# --preempt (-P): becomes a master as soon as possible -# --neutral (-n): don't run downscript at start if backup -# --advbase= (-b ): advertisement frequency -# --advskew= (-k ): advertisement skew (0-255) -# The rest of options list is built up by the UCARP initscript. - -OPTIONS="-k 128 -P" diff --git a/vip-common.conf b/vip-common.conf new file mode 100644 index 0000000..1a858b4 --- /dev/null +++ b/vip-common.conf @@ -0,0 +1,8 @@ +# Common VIP settings which can be overridden in individual vip-.conf +PASSWORD="love" +BIND_INTERFACE="eth0" +SOURCE_ADDRESS="" + +# If you have extra options to add, see "ucarp --help" output +OPTIONS="--shutdown --preempt" + diff --git a/vip-down b/vip-down index bbe78c0..fab9a8f 100755 --- a/vip-down +++ b/vip-down @@ -1,26 +1,5 @@ #!/bin/sh +exec 2>/dev/null -usage() -{ - echo "This script is intended to be run by the UCARP daemon." - echo "Usage: $0 " - echo "Usage: $0 <255.255.255.255> " - exit 1 -} - -[ $# -eq 3 ] || usage - -case $2 in - 255.255.255.255) - # New-style invocation. Process the the list of addresses - # specific to this virtual router. - MYDIR=`dirname $0` - $MYDIR/vip-helper.sh $3 del - ;; - *) - # Old-style invocation. Just add a single address to the same - # interface UCARP daemon is working on. - ip address del $2/32 dev $1 - ;; -esac +/sbin/ip address del "$2"/32 dev "$1" diff --git a/vip-up b/vip-up index b00106f..166729c 100755 --- a/vip-up +++ b/vip-up @@ -1,26 +1,5 @@ #!/bin/sh +exec 2>/dev/null -usage() -{ - echo "This script is intended to be run by the UCARP daemon." - echo "Usage: $0 " - echo "Usage: $0 <255.255.255.255> " - exit 1 -} - -[ $# -eq 3 ] || usage - -case $2 in - 255.255.255.255) - # New-style invocation. Process the the list of addresses - # specific to this virtual router. - MYDIR=`dirname $0` - $MYDIR/vip-helper.sh $3 add - ;; - *) - # Old-style invocation. Just add a single address to the same - # interface the UCARP daemon is working on. - ip address add $2/32 dev $1 - ;; -esac +/sbin/ip address add "$2"/32 dev "$1" From 93a7b8835fcc93a059f00c0203c6b79a230e6c30 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:13:15 +0000 Subject: [PATCH 03/16] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 503525f..d64a615 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NAME := ucarp SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 973533e4ecd90d25bf2225a77d8f652d75cc88c7 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:13:15 +0000 Subject: [PATCH 04/16] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 503525f..d64a615 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NAME := ucarp SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 8e15e3a68c46cf7b41fc4c9d16ea908ce6192949 Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Thu, 29 Apr 2010 13:22:13 +0000 Subject: [PATCH 05/16] Update, noreplace fix. --- sources | 2 +- ucarp.spec | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 5c48d2b..a0b412a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5b50ca5553bc520f4e639964c9ad5056 ucarp-1.5.tar.bz2 +723636dbf79fc6abd329a71ec4ddf79d ucarp-1.5.2.tar.bz2 diff --git a/ucarp.spec b/ucarp.spec index 0da0a6f..8560cb0 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,6 +1,6 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp -Version: 1.5 +Version: 1.5.2 Release: 1%{?dist} # See the COPYING file which details everything License: MIT and BSD @@ -94,10 +94,24 @@ fi %attr(0700,root,root) %dir /etc/ucarp/ %config(noreplace) /etc/ucarp/vip-common.conf /etc/ucarp/vip-001.conf.example -%{_libexecdir}/ucarp/ +%config(noreplace) %{_libexecdir}/ucarp/ %{_sbindir}/ucarp %changelog +* Wed Apr 28 2010 Jon Ciesla - 1.5.2-1 +- New upstream. +- Uses arc4random() if available. +- Avoids adverts that might be twice as what they should be. +- Marked vip-up and vip-down config(noreplace), BZ 586893. + +* Sun Jul 26 2009 Fedora Release Engineering - 1.5.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 08 2009 Jon Ciesla - 1.5.1-1 +- New upstream. +- New option (--nomcast / -M) to use broadcast +- advertisements instead of multicast ones. + * Mon Apr 13 2009 Jon Ciesla - 1.5-1 - Update to 1.5 BZ 458767. - Added LSB header to init script, BZ 247082. From 52ea21ce7f08bb8b7de6aa89ccdd8e411591e995 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 8 May 2010 02:26:31 +0000 Subject: [PATCH 06/16] Initialize branch EL-6 for ucarp --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..46381b9 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-6 From cf255c1aae56f5f21b08a6c143e73cf6049312ab Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Thu, 8 Jul 2010 13:45:21 +0000 Subject: [PATCH 07/16] Version bump. --- sources | 2 +- ucarp.spec | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sources b/sources index 0c1d427..a0b412a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9219ea8214198e8af751353a132087bb ucarp-1.5.1.tar.bz2 +723636dbf79fc6abd329a71ec4ddf79d ucarp-1.5.2.tar.bz2 diff --git a/ucarp.spec b/ucarp.spec index 5480809..8560cb0 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,7 +1,7 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp -Version: 1.5.1 -Release: 2%{?dist} +Version: 1.5.2 +Release: 1%{?dist} # See the COPYING file which details everything License: MIT and BSD Group: System Environment/Daemons @@ -94,10 +94,16 @@ fi %attr(0700,root,root) %dir /etc/ucarp/ %config(noreplace) /etc/ucarp/vip-common.conf /etc/ucarp/vip-001.conf.example -%{_libexecdir}/ucarp/ +%config(noreplace) %{_libexecdir}/ucarp/ %{_sbindir}/ucarp %changelog +* Wed Apr 28 2010 Jon Ciesla - 1.5.2-1 +- New upstream. +- Uses arc4random() if available. +- Avoids adverts that might be twice as what they should be. +- Marked vip-up and vip-down config(noreplace), BZ 586893. + * Sun Jul 26 2009 Fedora Release Engineering - 1.5.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild From 922f7c12ac53e2caf1e62b4a67c6e7e27d8d38d4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 14:36:21 +0000 Subject: [PATCH 08/16] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index d64a615..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: ucarp -# $Id$ -NAME := ucarp -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 42f697a..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-5 From 033985bacb9981c420a1debb4bb6519112fad0d5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 14:36:25 +0000 Subject: [PATCH 09/16] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index d64a615..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: ucarp -# $Id$ -NAME := ucarp -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 46381b9..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-6 From 3080009b6d97c569e20c259d2897b56acac5ca4b Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Thu, 25 Oct 2012 09:34:21 -0500 Subject: [PATCH 10/16] Fix for crash. --- ucarp-1.5.2-sighup.patch | 10 ++++++++++ ucarp.spec | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ucarp-1.5.2-sighup.patch diff --git a/ucarp-1.5.2-sighup.patch b/ucarp-1.5.2-sighup.patch new file mode 100644 index 0000000..8135233 --- /dev/null +++ b/ucarp-1.5.2-sighup.patch @@ -0,0 +1,10 @@ +--- src/carp.c~ 2010-01-31 15:59:12.000000000 -0600 ++++ src/carp.c 2012-10-25 09:25:54.949976635 -0500 +@@ -762,6 +762,7 @@ + + if (shutdown_at_exit != 0) { + (void) signal(SIGINT, sighandler_exit); ++ (void) signal(SIGHUP, sighandler_exit); + (void) signal(SIGQUIT, sighandler_exit); + (void) signal(SIGTERM, sighandler_exit); + } diff --git a/ucarp.spec b/ucarp.spec index 140d261..cbfde73 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,7 +1,7 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp Version: 1.5.2 -Release: 3%{?dist} +Release: 3.1%{?dist} # See the COPYING file which details everything License: MIT and BSD Group: System Environment/Daemons @@ -13,6 +13,7 @@ Source3: vip-common.conf Source4: vip-up Source5: vip-down #Source6: vip-helper.sh +Patch0: ucarp-1.5.2-sighup.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig, /sbin/service @@ -34,6 +35,7 @@ need for any dedicated extra network link between redundant hosts. %prep %setup -q +%patch0 -p0 %build %configure @@ -98,6 +100,9 @@ fi %{_sbindir}/ucarp %changelog +* Thu Oct 25 2012 Jon Ciesla - 1.5.2-3.1 +- Patch for crash. + * Sat Jan 14 2012 Fedora Release Engineering - 1.5.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild From 20ecf82b26a9e45fa0faf729163eab2a48c9618e Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Mon, 12 Nov 2012 14:44:59 -0600 Subject: [PATCH 11/16] Init fixes. --- ucarp.init | 31 ++++++++++++++++++++++--------- ucarp.spec | 9 ++++++++- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/ucarp.init b/ucarp.init index c7f6296..0680c07 100755 --- a/ucarp.init +++ b/ucarp.init @@ -24,8 +24,11 @@ [ ${NETWORKING} = "no" ] && exit 0 get_files() { - FILES=`find ${CONFDIR} -maxdepth 1 -type f -name 'vip-*.conf' \ - -printf "%f\n" | egrep '^vip-[[:digit:]]+\.conf$' | LC_COLLATE="C" sort` + local FILE + cd ${CONFDIR} + for FILE in *.conf + do [ "${FILE}" != "${CONFDIR}/vip-common.conf" ] && echo -n "${FILE} " + done } prog=$"common address redundancy protocol daemon" @@ -40,7 +43,7 @@ start() { echo -n $"Starting ${prog}: " - get_files + FILES=`get_files` if [ -z "${FILES}" ]; then ${LOGGER} "no virtual addresses are configured in ${CONFDIR}" @@ -48,17 +51,27 @@ start() { RETVAL=1 else for FILE in ${FILES}; do - # Check that the file name gives us an ID between 1 and 255 - ID=`echo ${FILE}| sed 's/^vip-\(.*\).conf/\1/'` + + unset ID PASSWORD BIND_INTERFACE SOURCE_ADDRESS VIP_ADDRESS OPTIONS + + . ${CONFDIR}/vip-common.conf + . ${CONFDIR}/${FILE} + + # If the SOURCE_ADDRESS is not defined in the config, guess it from the ifcfg file + [ ${SOURCE_ADDRESS} ] || SOURCE_ADDRESS=$( . /etc/sysconfig/network-scripts/ifcfg-${BIND_INTERFACE} ; echo $IPADDR ) + + # If a value for MASTER is set in the file, use it to set advskew value + # The default advskew is 0, so if we are not the master, add advskew=1 to the options + [ "${MASTER:-NULL}" == "${SOURCE_ADDRESS}" ] || OPTIONS="${OPTIONS} --advskew=1" + + # Set the ID from the config file if it's defined, otherwise guess from the filename + [ ${ID} ] || ID=`echo ${FILE} | sed 's/^vip-\(.*\).conf/\1/'` + if [ ${ID} -lt 1 -o ${ID} -gt 255 ]; then ${LOGGER} "ID out of range (1-255) for ${FILE}, skipped VIP ID ${ID}" continue fi - unset PASSWORD BIND_INTERFACE SOURCE_ADDRESS VIP_ADDRESS OPTIONS - # Source ucarp settings - . ${CONFDIR}/vip-common.conf - . ${CONFDIR}/${FILE} TMP_RETVAL=0 if [ -z "${PASSWORD}" ]; then diff --git a/ucarp.spec b/ucarp.spec index cbfde73..0b43bc7 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,7 +1,7 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp Version: 1.5.2 -Release: 3.1%{?dist} +Release: 4%{?dist} # See the COPYING file which details everything License: MIT and BSD Group: System Environment/Daemons @@ -100,6 +100,13 @@ fi %{_sbindir}/ucarp %changelog +* Thu Oct 25 2012 Jon Ciesla - 1.5.2-4 +- Init script fixes from Trent Johnson and Dan Bassett at oreilly.com: +- Changed the get_files function in order to allow file names that don't include the ID. +- Moved config sourcing earlier in the script, allowing the ID parameter to be defined in the config, rather than the filename, if desired. +- Added a MASTER parameter option to the config file, allowing a master node to be selected in a deterministic way using the advskew. +- Added the ability to define the SOURCE_ADDRESS either in the config file, or using IPADDR from the ifcfg-$BIND_INTERFACE file. + * Thu Oct 25 2012 Jon Ciesla - 1.5.2-3.1 - Patch for crash. From 0c5ad791774bc5f50a5f29a7deaf41868730cf9f Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Tue, 13 Nov 2012 11:46:43 -0600 Subject: [PATCH 12/16] Patch fix. --- ucarp.init | 2 +- ucarp.spec | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ucarp.init b/ucarp.init index 0680c07..0231a01 100755 --- a/ucarp.init +++ b/ucarp.init @@ -27,7 +27,7 @@ get_files() { local FILE cd ${CONFDIR} for FILE in *.conf - do [ "${FILE}" != "${CONFDIR}/vip-common.conf" ] && echo -n "${FILE} " + do [ "${FILE}" != "vip-common.conf" ] && echo -n "${FILE} " done } diff --git a/ucarp.spec b/ucarp.spec index 0b43bc7..6fc27ee 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,7 +1,7 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp Version: 1.5.2 -Release: 4%{?dist} +Release: 5%{?dist} # See the COPYING file which details everything License: MIT and BSD Group: System Environment/Daemons @@ -100,7 +100,10 @@ fi %{_sbindir}/ucarp %changelog -* Thu Oct 25 2012 Jon Ciesla - 1.5.2-4 +* Tue Nov 13 2012 Jon Ciesla - 1.5.2-5 +- Additional init fix. + +* Mon Nov 12 2012 Jon Ciesla - 1.5.2-4 - Init script fixes from Trent Johnson and Dan Bassett at oreilly.com: - Changed the get_files function in order to allow file names that don't include the ID. - Moved config sourcing earlier in the script, allowing the ID parameter to be defined in the config, rather than the filename, if desired. From 9ddc1b70e9722f549740ee4eced8f009cbaf2b5a Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Tue, 11 Dec 2012 09:04:43 -0600 Subject: [PATCH 13/16] init fix for octal. --- ucarp.init | 15 ++++++++++++++- ucarp.spec | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ucarp.init b/ucarp.init index 0231a01..dfcf3e9 100755 --- a/ucarp.init +++ b/ucarp.init @@ -65,7 +65,20 @@ start() { [ "${MASTER:-NULL}" == "${SOURCE_ADDRESS}" ] || OPTIONS="${OPTIONS} --advskew=1" # Set the ID from the config file if it's defined, otherwise guess from the filename - [ ${ID} ] || ID=`echo ${FILE} | sed 's/^vip-\(.*\).conf/\1/'` + if [[ -z "$ID" ]]; then + ID="${FILE#vip-}"; ID="${ID%.conf}" + IDnozero="${ID#0}"; IDnozero="${IDnozero#0}" + if [[ "$ID" != "$IDnozero" ]]; then + if [[ "${ID}" != "${ID/8}" || "${ID}" != "${ID/9}" ]]; then + # Has leading zeroes, is not a valid octal number. + # Remove leading zeroes, interpret it as decimal. + ID="$IDnozero" + else + # Has leading zeroes, will be interpreted as octal. + ${LOGGER} "$FILE uses VIP ID" $(($ID)) "(octal $ID). To use $ID, add the line 'ID=$IDnozero' to $FILE or rename it to vip-$IDnozero.conf" + fi + fi + fi if [ ${ID} -lt 1 -o ${ID} -gt 255 ]; then ${LOGGER} "ID out of range (1-255) for ${FILE}, skipped VIP ID ${ID}" diff --git a/ucarp.spec b/ucarp.spec index 6fc27ee..c7d27e1 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,7 +1,7 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp Version: 1.5.2 -Release: 5%{?dist} +Release: 6%{?dist} # See the COPYING file which details everything License: MIT and BSD Group: System Environment/Daemons @@ -100,6 +100,9 @@ fi %{_sbindir}/ucarp %changelog +* Tue Dec 11 2012 Jon Ciesla - 1.5.2-6 +- init fix from Alexander Bostrom, BZ 809421. + * Tue Nov 13 2012 Jon Ciesla - 1.5.2-5 - Additional init fix. From da59abbadd7d2257725a541ef1f1e81d6a29c6d5 Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Wed, 23 Jan 2013 13:02:44 -0600 Subject: [PATCH 14/16] Drop MASTER from init. --- ucarp.init | 3 ++- ucarp.spec | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ucarp.init b/ucarp.init index dfcf3e9..c2e01e1 100755 --- a/ucarp.init +++ b/ucarp.init @@ -62,7 +62,8 @@ start() { # If a value for MASTER is set in the file, use it to set advskew value # The default advskew is 0, so if we are not the master, add advskew=1 to the options - [ "${MASTER:-NULL}" == "${SOURCE_ADDRESS}" ] || OPTIONS="${OPTIONS} --advskew=1" + #commented out per BZ 896576 + #[ "${MASTER:-NULL}" == "${SOURCE_ADDRESS}" ] || OPTIONS="${OPTIONS} --advskew=1" # Set the ID from the config file if it's defined, otherwise guess from the filename if [[ -z "$ID" ]]; then diff --git a/ucarp.spec b/ucarp.spec index c7d27e1..86ca95b 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,7 +1,7 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp Version: 1.5.2 -Release: 6%{?dist} +Release: 7%{?dist} # See the COPYING file which details everything License: MIT and BSD Group: System Environment/Daemons @@ -100,6 +100,9 @@ fi %{_sbindir}/ucarp %changelog +* Wed Jan 23 2013 Jon Ciesla - 1.5.2-7 +- Dropped MASTER from init, BZ 896576. + * Tue Dec 11 2012 Jon Ciesla - 1.5.2-6 - init fix from Alexander Bostrom, BZ 809421. From bd68be23ff7ace30026bceeba3850a2e866fc3d4 Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Wed, 13 Feb 2013 09:03:23 -0600 Subject: [PATCH 15/16] init fix. --- ucarp.init | 8 +++++--- ucarp.spec | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ucarp.init b/ucarp.init index c2e01e1..d9819e4 100755 --- a/ucarp.init +++ b/ucarp.init @@ -61,9 +61,11 @@ start() { [ ${SOURCE_ADDRESS} ] || SOURCE_ADDRESS=$( . /etc/sysconfig/network-scripts/ifcfg-${BIND_INTERFACE} ; echo $IPADDR ) # If a value for MASTER is set in the file, use it to set advskew value - # The default advskew is 0, so if we are not the master, add advskew=1 to the options - #commented out per BZ 896576 - #[ "${MASTER:-NULL}" == "${SOURCE_ADDRESS}" ] || OPTIONS="${OPTIONS} --advskew=1" + # The default advskew is 0, so if we are not the master, add advskew=1 to the options + # If the skew is already set in the options, then ignore the MASTER parameter + if ! [[ "${OPTIONS}" =~ "-k" || "${OPTIONS}" =~ "-advskew" ]]; then + [ "${MASTER:-NULL}" == "${SOURCE_ADDRESS}" ] || OPTIONS="${OPTIONS} --advskew=1" + fi # Set the ID from the config file if it's defined, otherwise guess from the filename if [[ -z "$ID" ]]; then diff --git a/ucarp.spec b/ucarp.spec index 86ca95b..fc9db16 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,7 +1,7 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp Version: 1.5.2 -Release: 7%{?dist} +Release: 8%{?dist} # See the COPYING file which details everything License: MIT and BSD Group: System Environment/Daemons @@ -100,6 +100,9 @@ fi %{_sbindir}/ucarp %changelog +* Wed Feb 13 2013 Jon Ciesla - 1.5.2-8 +- Additional init fix, Trent Johnson. + * Wed Jan 23 2013 Jon Ciesla - 1.5.2-7 - Dropped MASTER from init, BZ 896576. From 9e8215d18b8312ab10e7c00933630adca742d454 Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Sat, 5 Mar 2016 12:23:19 -0500 Subject: [PATCH 16/16] Init fix. --- ucarp.init | 2 +- ucarp.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ucarp.init b/ucarp.init index d9819e4..1abb550 100755 --- a/ucarp.init +++ b/ucarp.init @@ -21,7 +21,7 @@ . /etc/sysconfig/network # Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 +[ "${NETWORKING}" = "no" ] && exit 0 get_files() { local FILE diff --git a/ucarp.spec b/ucarp.spec index fc9db16..ad4a91b 100644 --- a/ucarp.spec +++ b/ucarp.spec @@ -1,7 +1,7 @@ Summary: Common Address Redundancy Protocol (CARP) for Unix Name: ucarp Version: 1.5.2 -Release: 8%{?dist} +Release: 9%{?dist} # See the COPYING file which details everything License: MIT and BSD Group: System Environment/Daemons @@ -100,6 +100,9 @@ fi %{_sbindir}/ucarp %changelog +* Sat Mar 05 2016 Jon Ciesla - 1.5.2-9 +- Additional init fix, Petr Poky + * Wed Feb 13 2013 Jon Ciesla - 1.5.2-8 - Additional init fix, Trent Johnson.