rpms/ucarp/EL-5 vip-common.conf, NONE, 1.1 sources, 1.4, 1.5 ucarp.init, 1.1, 1.2 ucarp.spec, 1.13, 1.14 vip-001.conf.example, 1.3, 1.4 vip-down, 1.2, 1.3 vip-up, 1.2, 1.3

Jon Ciesla limb at fedoraproject.org
Wed Jul 8 17:41:07 UTC 2009


Author: limb

Update of /cvs/pkgs/rpms/ucarp/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7030/EL-5

Modified Files:
	sources ucarp.init ucarp.spec vip-001.conf.example vip-down 
	vip-up 
Added Files:
	vip-common.conf 
Log Message:
1.1 and 1.3 were never build, updating to 1.5 and building, BZ 510287.



--- NEW FILE vip-common.conf ---
# Common VIP settings which can be overridden in individual vip-<nnnn>.conf
PASSWORD="love"
BIND_INTERFACE="eth0"
SOURCE_ADDRESS=""

# If you have extra options to add, see "ucarp --help" output
OPTIONS="--shutdown --preempt"



Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/ucarp/EL-5/sources,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- sources	20 Jun 2006 22:55:39 -0000	1.4
+++ sources	8 Jul 2009 17:41:06 -0000	1.5
@@ -1 +1 @@
-bed7ae84520f2e0faf3e68e9cfe4e1aa  ucarp-1.2.tar.bz2
+5b50ca5553bc520f4e639964c9ad5056  ucarp-1.5.tar.bz2


Index: ucarp.init
===================================================================
RCS file: /cvs/pkgs/rpms/ucarp/EL-5/ucarp.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- ucarp.init	5 Feb 2007 13:06:40 -0000	1.1
+++ ucarp.init	8 Jul 2009 17:41:06 -0000	1.2
@@ -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_INTERFACE}" ]; then
+                ${LOGGER} "no BIND_INTERFACE 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 "${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


Index: ucarp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ucarp/EL-5/ucarp.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- ucarp.spec	5 Feb 2007 13:06:40 -0000	1.13
+++ ucarp.spec	8 Jul 2009 17:41:06 -0000	1.14
@@ -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 lin
 
 
 %prep
-%setup
-%patch -p1
+%setup -q
 
 
 %build
@@ -51,14 +50,15 @@ need for any dedicated extra network lin
     %{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 <limb at jcomserv.net> - 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 <rel-eng at lists.fedoraproject.org> - 1.4-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Sun Feb  3 2008 Matthias Saou <http://freshrpms.net/> 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 <http://freshrpms.net/> 1.2-9
+- Rebuild for new BuildID feature.
+
+* Sun Aug  5 2007 Matthias Saou <http://freshrpms.net/> 1.2-8
+- Update License field.
+
 * Fri Feb  2 2007 Matthias Saou <http://freshrpms.net/> 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


Index: vip-001.conf.example
===================================================================
RCS file: /cvs/pkgs/rpms/ucarp/EL-5/vip-001.conf.example,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- vip-001.conf.example	29 Nov 2006 12:00:11 -0000	1.3
+++ vip-001.conf.example	8 Jul 2009 17:41:06 -0000	1.4
@@ -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$
-
-# 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"
-
-# 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"
+# network to be taken over by one of the routers.
+VIP_ADDRESS="10.0.0.254"
 
-# If you have extra options to add, see "ucarp --help" output
-# (the lower the "-k <val>" 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=<seconds> (-b <seconds>): advertisement frequency
-# --advskew=<skew> (-k <skew>): advertisement skew (0-255)
-# The rest of options list is built up by the UCARP initscript.
+# In more complex scenarios, check the "vip-common" file for values to override
+# and how to add options.
 
-OPTIONS="-k 128 -P"


Index: vip-down
===================================================================
RCS file: /cvs/pkgs/rpms/ucarp/EL-5/vip-down,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- vip-down	5 Feb 2007 13:06:40 -0000	1.2
+++ vip-down	8 Jul 2009 17:41:06 -0000	1.3
@@ -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 <network interface> <IP address> <anything>"
-    echo "Usage: $0 <anything> <255.255.255.255> <virtual router ID>"
-    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"
 


Index: vip-up
===================================================================
RCS file: /cvs/pkgs/rpms/ucarp/EL-5/vip-up,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- vip-up	5 Feb 2007 13:06:40 -0000	1.2
+++ vip-up	8 Jul 2009 17:41:06 -0000	1.3
@@ -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 <network interface> <IP address> <anything>"
-    echo "Usage: $0 <anything> <255.255.255.255> <virtual router ID>"
-    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"
 




More information about the scm-commits mailing list