[svn] r5138 - trunk/rpms/keepalived

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Tue Feb 6 14:19:00 CET 2007


Author: thias
Date: 2007-02-06 14:18:58 +0100 (Tue, 06 Feb 2007)
New Revision: 5138

Added:
   trunk/rpms/keepalived/keepalived-1.1.13-iflabel.patch
   trunk/rpms/keepalived/keepalived-1.1.13-makefile.patch
   trunk/rpms/keepalived/keepalived.init
   trunk/rpms/keepalived/keepalived.sysconfig
Modified:
   trunk/rpms/keepalived/keepalived.spec
Log:
Update keepalived to 1.1.13 + major improvements.


Added: trunk/rpms/keepalived/keepalived-1.1.13-iflabel.patch
===================================================================
--- trunk/rpms/keepalived/keepalived-1.1.13-iflabel.patch	                        (rev 0)
+++ trunk/rpms/keepalived/keepalived-1.1.13-iflabel.patch	2007-02-06 13:18:58 UTC (rev 5138)
@@ -0,0 +1,153 @@
+Index: doc/keepalived.conf.SYNOPSIS
+===================================================================
+RCS file: /sourceforge/cvs/abrazo/base/os/packages/keepalived/doc/keepalived.conf.SYNOPSIS,v
+retrieving revision 1.1.1.2
+diff -u -r1.1.1.2 keepalived.conf.SYNOPSIS
+--- doc/keepalived.conf.SYNOPSIS	27 Nov 2006 15:27:50 -0000	1.1.1.2
++++ doc/keepalived.conf.SYNOPSIS	27 Nov 2006 16:50:00 -0000
+@@ -165,8 +165,8 @@
+         auth_pass <STRING>		# Password string
+     }
+     virtual_ipaddress {			# VRRP IP addres block
+-        <IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
+-        <IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
++        <IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE> label <LABEL>
++        <IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE> label <LABEL>
+         ...
+     }
+     virtual_ipaddress_excluded {       	# VRRP IP excluded from VRRP
+@@ -198,6 +198,10 @@
+ 	* nowhere
+ 	* global
+ 
++LABEL is optional and creates a name for the alias. For compatibility with
++"ifconfig", it should be of the form <realdev>:<anytext>, for example
++eth0:1 for an alias on eth0.
++
+ When a weight is specified in track_interface, instead of setting the vrrp
+ instance to the FAULT state in case of failure, its priority will be
+ increased by the weight when the interface is up (for positive weights),
+Index: doc/man/man5/keepalived.conf.5
+===================================================================
+RCS file: /sourceforge/cvs/abrazo/base/os/packages/keepalived/doc/man/man5/keepalived.conf.5,v
+retrieving revision 1.1.1.1
+diff -u -r1.1.1.1 keepalived.conf.5
+--- doc/man/man5/keepalived.conf.5	1 Aug 2006 15:49:31 -0000	1.1.1.1
++++ doc/man/man5/keepalived.conf.5	27 Nov 2006 16:50:00 -0000
+@@ -199,9 +199,9 @@
+     #With the same entries on other machines,
+     #the opposite transition will be occuring.
+     virtual_ipaddress {
+-        <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE>
++        <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE> label <LABEL>
+         192.168.200.17/24 dev eth1
+-        192.168.200.18/24 dev eth2
++        192.168.200.18/24 dev eth2 label eth2:1
+     }
+ 
+     #VRRP IP excluded from VRRP
+Index: doc/samples/keepalived.conf.vrrp
+===================================================================
+RCS file: /sourceforge/cvs/abrazo/base/os/packages/keepalived/doc/samples/keepalived.conf.vrrp,v
+retrieving revision 1.1.1.1
+diff -u -r1.1.1.1 keepalived.conf.vrrp
+--- doc/samples/keepalived.conf.vrrp	1 Aug 2006 15:49:31 -0000	1.1.1.1
++++ doc/samples/keepalived.conf.vrrp	27 Nov 2006 16:50:00 -0000
+@@ -26,7 +26,10 @@
+     virtual_ipaddress {
+         192.168.200.16
+         192.168.200.17
+-        192.168.200.18
++
++        # optional label. should be of the form "realdev:sometext" for
++        # compatibility with ifconfig.
++        192.168.200.18 label eth0:1
+     }
+ }
+ 
+Index: keepalived/etc/keepalived/keepalived.conf
+===================================================================
+RCS file: /sourceforge/cvs/abrazo/base/os/packages/keepalived/keepalived/etc/keepalived/keepalived.conf,v
+retrieving revision 1.1.1.1
+diff -u -r1.1.1.1 keepalived.conf
+--- keepalived/etc/keepalived/keepalived.conf	1 Aug 2006 15:49:31 -0000	1.1.1.1
++++ keepalived/etc/keepalived/keepalived.conf	27 Nov 2006 16:50:00 -0000
+@@ -25,7 +25,7 @@
+     virtual_ipaddress {
+         192.168.200.16
+         192.168.200.17
+-        192.168.200.18
++        192.168.200.18 label eth0:3
+     }
+ }
+ 
+Index: keepalived/include/vrrp_ipaddress.h
+===================================================================
+RCS file: /sourceforge/cvs/abrazo/base/os/packages/keepalived/keepalived/include/vrrp_ipaddress.h,v
+retrieving revision 1.1.1.2
+diff -u -r1.1.1.2 vrrp_ipaddress.h
+--- keepalived/include/vrrp_ipaddress.h	27 Nov 2006 15:27:50 -0000	1.1.1.2
++++ keepalived/include/vrrp_ipaddress.h	27 Nov 2006 16:50:00 -0000
+@@ -46,6 +46,7 @@
+ 	interface *ifp;		/* Interface owning IP address */
+ 	int scope;		/* the ip address scope */
+ 	int set;		/* TRUE if addr is set */
++	char *label;		/* Alias name, e.g. eth0:1 */
+ } ip_address;
+ 
+ #define IPADDRESS_DEL 0
+Index: keepalived/vrrp/vrrp_ipaddress.c
+===================================================================
+RCS file: /sourceforge/cvs/abrazo/base/os/packages/keepalived/keepalived/vrrp/vrrp_ipaddress.c,v
+retrieving revision 1.1.1.2
+diff -u -r1.1.1.2 vrrp_ipaddress.c
+--- keepalived/vrrp/vrrp_ipaddress.c	27 Nov 2006 15:27:50 -0000	1.1.1.2
++++ keepalived/vrrp/vrrp_ipaddress.c	27 Nov 2006 16:50:00 -0000
+@@ -53,6 +53,9 @@
+ 	if (ipaddr->broadcast)
+ 		addattr_l(&req.n, sizeof (req), IFA_BROADCAST,
+ 			  &ipaddr->broadcast, sizeof (ipaddr->broadcast));
++	if (ipaddr->label)
++		addattr_l(&req.n, sizeof (req), IFA_LABEL,
++                          ipaddr->label, strlen(ipaddr->label) + 1);
+ 
+ 	if (netlink_talk(&nl_cmd, &req.n) < 0)
+ 		status = -1;
+@@ -90,18 +93,23 @@
+ void
+ free_ipaddress(void *if_data_obj)
+ {
+-	FREE(if_data_obj);
++	ip_address *ip_addr = if_data_obj;
++
++	FREE_PTR(ip_addr->label);
++	FREE(ip_addr);
+ }
+ void
+ dump_ipaddress(void *if_data_obj)
+ {
+ 	ip_address *ip_addr = if_data_obj;
+-	syslog(LOG_INFO, "     %s/%d brd %s dev %s scope %s"
++	syslog(LOG_INFO, "     %s/%d brd %s dev %s scope %s%s%s"
+ 	       , inet_ntop2(ip_addr->addr)
+ 	       , ip_addr->mask
+ 	       , inet_ntop2(ip_addr->broadcast)
+ 	       , IF_NAME(if_get_by_ifindex(ip_addr->ifindex))
+-	       , netlink_scope_n2a(ip_addr->scope));
++	       , netlink_scope_n2a(ip_addr->scope)
++               , ip_addr->label ? " label " : ""
++               , ip_addr->label ? ip_addr->label : "");
+ }
+ void
+ alloc_ipaddress(list ip_list, vector strvec, interface *ifp)
+@@ -139,6 +147,10 @@
+ 			new->scope = netlink_scope_a2n(VECTOR_SLOT(strvec, ++i));
+ 		} else if (!strcmp(str, "broadcast") || !strcmp(str, "brd")) {
+ 			inet_ston(VECTOR_SLOT(strvec, ++i), &new->broadcast);
++		} else if (!strcmp(str, "label")) {
++			new->label = ALLOC(IFNAMSIZ);
++			strncpy(new->label, VECTOR_SLOT(strvec, ++i), IFNAMSIZ);
++			new->label[IFNAMSIZ-1] = '\0';
+ 		} else {
+ 			if (inet_ston(VECTOR_SLOT(strvec, i), &ipaddr)) {
+ 				inet_ston(VECTOR_SLOT(strvec, i), &new->addr);

Added: trunk/rpms/keepalived/keepalived-1.1.13-makefile.patch
===================================================================
--- trunk/rpms/keepalived/keepalived-1.1.13-makefile.patch	                        (rev 0)
+++ trunk/rpms/keepalived/keepalived-1.1.13-makefile.patch	2007-02-06 13:18:58 UTC (rev 5138)
@@ -0,0 +1,76 @@
+diff -Naupr keepalived-1.1.13.orig/genhash/Makefile.in keepalived-1.1.13/genhash/Makefile.in
+--- keepalived-1.1.13.orig/genhash/Makefile.in	2006-10-11 11:46:49.000000000 +0200
++++ keepalived-1.1.13/genhash/Makefile.in	2007-01-25 19:27:44.000000000 +0100
+@@ -7,7 +7,8 @@ BIN  = ../bin
+ 
+ prefix      = @prefix@
+ exec_prefix = @exec_prefix@
+-bindir     = @bindir@
++bindir      = @bindir@
++mandir      = @mandir@
+ 
+ CC = @CC@
+ STRIP = @STRIP@
+@@ -39,13 +40,13 @@ distclean: clean
+ 
+ uninstall:
+ 	rm -f $(DESTDIR)$(bindir)/$(EXEC)
+-	rm -f $(DESTDIR)@mandir@/man/man1/genhash.1
++	rm -f $(DESTDIR)$(mandir)/man1/genhash.1
+ 
+ install:
+ 	install -d $(DESTDIR)$(bindir)
+ 	install -m 755 $(BIN)/$(EXEC) $(DESTDIR)$(bindir)/
+-	install -d $(DESTDIR)@mandir@/man/man1
+-	install -m 644 ../doc/man/man1/genhash.1 $(DESTDIR)@mandir@/man/man1
++	install -d $(DESTDIR)$(mandir)/man1
++	install -m 644 ../doc/man/man1/genhash.1 $(DESTDIR)$(mandir)/man1
+ 
+ mrproper: clean distclean
+ 	rm -f config.*
+diff -Naupr keepalived-1.1.13.orig/keepalived/Makefile.in keepalived-1.1.13/keepalived/Makefile.in
+--- keepalived-1.1.13.orig/keepalived/Makefile.in	2006-10-11 11:46:32.000000000 +0200
++++ keepalived-1.1.13/keepalived/Makefile.in	2007-01-25 19:35:07.000000000 +0100
+@@ -14,8 +14,9 @@ prefix      = @prefix@
+ exec_prefix = @exec_prefix@
+ sbindir     = @sbindir@
+ sysconfdir  = @sysconfdir@
+-init_script = etc/init.d/keepalived.init
+-conf_file   = etc/keepalived/keepalived.conf
++mandir      = @mandir@
++init_dir    = $(sysconfdir)/rc.d/init.d
++conf_dir    = $(sysconfdir)/keepalived
+ 
+ CC = @CC@
+ STRIP = @STRIP@
+@@ -89,20 +90,20 @@ mrproper: distclean
+ 
+ uninstall:
+ 	rm -f $(DESTDIR)$(sbindir)/$(EXEC)
++	rm -f $(DESTDIR)$(init_dir)/keepalived.init
+ 	rm -rf $(DESTDIR)$(sysconfdir)/keepalived
+-	rm -f $(DESTDIR)$(init_dir)/$(init_script)
+-	rm -f $(DESTDIR)@mandir@/man/man5/keepalived.conf.5
+-	rm -f $(DESTDIR)@mandir@/man/man8/keepalived.8
++	rm -f $(DESTDIR)$(mandir)/man/man5/keepalived.conf.5
++	rm -f $(DESTDIR)$(mandir)/man/man8/keepalived.8
+ 
+ install:
+ 	install -d $(DESTDIR)$(sbindir)
+ 	install -m 700 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/
+-	install -d $(DESTDIR)$(sysconfdir)/init.d
+-	install -m 755 $(init_script) $(DESTDIR)$(sysconfdir)/init.d/keepalived
++	install -d $(DESTDIR)$(init_dir)
++	install -m 755 etc/init.d/keepalived.init $(DESTDIR)$(init_dir)/keepalived
+ 	install -d $(DESTDIR)$(sysconfdir)/keepalived/samples
+-	install -m 644 $(conf_file) $(DESTDIR)$(sysconfdir)/keepalived/
++	install -m 644 etc/keepalived/keepalived.conf $(DESTDIR)$(sysconfdir)/keepalived/
+ 	install -m 644 ../doc/samples/* $(DESTDIR)$(sysconfdir)/keepalived/samples/
+-	install -d $(DESTDIR)@mandir@/man/man5
+-	install -d $(DESTDIR)@mandir@/man/man8
+-	install -m 644 ../doc/man/man5/keepalived.conf.5 $(DESTDIR)@mandir@/man/man5
+-	install -m 644 ../doc/man/man8/keepalived.8 $(DESTDIR)@mandir@/man/man8
++	install -d $(DESTDIR)$(mandir)/man5
++	install -d $(DESTDIR)$(mandir)/man8
++	install -m 644 ../doc/man/man5/keepalived.conf.5 $(DESTDIR)$(mandir)/man5
++	install -m 644 ../doc/man/man8/keepalived.8 $(DESTDIR)$(mandir)/man8

Added: trunk/rpms/keepalived/keepalived.init
===================================================================
--- trunk/rpms/keepalived/keepalived.init	                        (rev 0)
+++ trunk/rpms/keepalived/keepalived.init	2007-02-06 13:18:58 UTC (rev 5138)
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# Startup script for the Keepalived daemon
+#
+# processname: keepalived
+# pidfile: /var/run/keepalived.pid
+# config: /etc/keepalived/keepalived.conf
+# chkconfig: - 21 79
+# description: Start and stop Keepalived
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Source configuration file (we set KEEPALIVED_OPTIONS there)
+. /etc/sysconfig/keepalived
+
+RETVAL=0
+
+prog="keepalived"
+
+start() {
+    echo -n $"Starting $prog: "
+    daemon keepalived ${KEEPALIVED_OPTIONS}
+    RETVAL=$?
+    echo
+    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc keepalived
+    RETVAL=$?
+    echo
+    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+}
+
+reload() {
+    echo -n $"Reloading $prog: "
+    killproc keepalived -1
+    RETVAL=$?
+    echo
+}
+
+# See how we were called.
+case "$1" in
+    start)
+        start
+        ;;
+    stop)
+        stop
+        ;;
+    reload)
+        reload
+        ;;
+    restart)
+        stop
+        start
+        ;;
+    condrestart)
+        if [ -f /var/lock/subsys/$prog ]; then
+            stop
+            start
+        fi
+        ;;
+    status)
+        status keepalived
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
+        exit 1
+esac
+
+exit $RETVAL


Property changes on: trunk/rpms/keepalived/keepalived.init
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/rpms/keepalived/keepalived.spec
===================================================================
--- trunk/rpms/keepalived/keepalived.spec	2007-02-05 08:50:37 UTC (rev 5137)
+++ trunk/rpms/keepalived/keepalived.spec	2007-02-06 13:18:58 UTC (rev 5138)
@@ -1,22 +1,28 @@
 # $Id$
 # Authority: dag
 
-### FIXME: FC3 and EL4 do not have kernel-source packages. No IPVS
-%{?dist: %{expand: %%define %dist 1}}
-%{!?kernel:%define kernel %(rpm --quiet -q kernel-source && rpm -q kernel-source --qf '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}\\n' | tail -1)}
+%define kernel %(rpm -q kernel-devel --qf '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' 2>/dev/null || rpm -q kernel-source --qf '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' 2>/dev/null| tail -1)
 
 Summary: HA monitor built upon LVS, VRRP and services poller
 Name: keepalived
-Version: 1.1.12
-Release: 1.2
+Version: 1.1.13
+Release: 2
 License: GPL
 Group: Applications/System
-URL: http://keepalived.sourceforge.net/
+URL: http://www.keepalived.org/
 
-Source: http://www.keepalived.org/software/keepalived-%{version}.tar.gz
+Source0: http://www.keepalived.org/software/keepalived-%{version}.tar.gz
+Source1: keepalived.init
+Source2: keepalived.sysconfig
+Patch0: keepalived-1.1.13-makefile.patch
+Patch1: keepalived-1.1.13-iflabel.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 
 BuildRequires: openssl-devel
+# For recent distros where kernel-devel is available, we need both of these
+BuildRequires: kernel, kernel-devel
+# For older distros, this should probably be enough
+#BuildRequires: kernel-source
 
 %description
 The main goal of the keepalived project is to add a strong & robust
@@ -35,55 +41,72 @@
 
 %prep
 %setup
+%patch0 -p1 -b .makefile
+%patch1 -p0 -b .iflabel
 
-### FIXME: Fix macros in buildtools (Please fix upstream)
-%{__perl} -pi.orig -e '
-		s|\$\(prefix\)(\@mandir\@)|$1|;
-		s|(\@mandir\@)/man|$1|;
-	' Makefile.in */Makefile.in
-
 %build
 %{?el3:export CPPFLAGS="-I/usr/kerberos/include"}
 %{?rh9:export CPPFLAGS="-I/usr/kerberos/include"}
 %configure \
 %{?el3:--includedir="/usr/kerberos/include"} \
 %{?rh9:--includedir="/usr/kerberos/include"} \
-	--with-kernel-dir="/lib/modules/%{kernel}/build"
+    --with-kernel-dir="/lib/modules/%{kernel}/build"
 %{__make} %{?_smp_mflags}
 
 %install
 %{__rm} -rf %{buildroot}
-%{__make} install \
-	DESTDIR="%{buildroot}"
+%{__make} install DESTDIR="%{buildroot}"
+# Remove "samples", as we include them in %%doc
+%{__rm} -rf %{buildroot}%{_sysconfdir}/keepalived/samples/
+# Init script (based on the included one, but enhanced)
+%{__install} -D -p -m 0755 %{SOURCE1} \
+    %{buildroot}%{_sysconfdir}/rc.d/init.d/keepalived
+# Sysconfig file (used by the init script)
+%{__install} -D -p -m 0755 %{SOURCE2} \
+    %{buildroot}%{_sysconfdir}/sysconfig/keepalived
 
+%clean
+%{__rm} -rf %{buildroot}
+
 %post
 /sbin/chkconfig --add keepalived
 
 %preun
 if [ $1 -eq 0 ]; then
-	/sbin/service keepalived stop &>/dev/null || :
-	/sbin/chkconfig --del keepalived
+    /sbin/service keepalived stop &>/dev/null || :
+    /sbin/chkconfig --del keepalived
 fi
 
 %postun
-/sbin/service keepalived condrestart &>/dev/null || :
+if [ $1 -ge 1 ]; then
+    /sbin/service keepalived condrestart &>/dev/null || :
+fi
 
-%clean
-%{__rm} -rf %{buildroot}
-
 %files
 %defattr(-, root, root, 0755)
-%doc AUTHOR ChangeLog CONTRIBUTORS COPYING doc/ README TODO
-%doc %{_mandir}/man1/genhash.1*
-%doc %{_mandir}/man5/keepalived.conf.5*
-%doc %{_mandir}/man8/keepalived.8*
-#%config %{_initrddir}/*
-%config(noreplace) %{_sysconfdir}/keepalived/
-%config %{_sysconfdir}/init.d/keepalived
+%doc AUTHOR ChangeLog CONTRIBUTORS COPYING README TODO
+%doc doc/keepalived.conf.SYNOPSIS doc/samples/
+%dir %{_sysconfdir}/keepalived/
+%attr(0600, root, root) %config(noreplace) %{_sysconfdir}/keepalived/keepalived.conf
+%attr(0600, root, root) %config(noreplace) %{_sysconfdir}/sysconfig/keepalived
+%{_sysconfdir}/rc.d/init.d/keepalived
 %{_bindir}/genhash
 %{_sbindir}/keepalived
+%{_mandir}/man1/genhash.1*
+%{_mandir}/man5/keepalived.conf.5*
+%{_mandir}/man8/keepalived.8*
 
 %changelog
+* Mon Feb  5 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-2
+- Use our own init script, include a sysconfig entry used by it for options.
+
+* Thu Jan 25 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-1
+- Update to 1.1.13.
+- Change mode of configuration file to 0600.
+- Don't include all of "doc" since it meant re-including all man pages.
+- Don't include samples in the main configuration path, they're in %%doc.
+- Include patch to add an optional label to interfaces.
+
 * Sat Apr 08 2006 Dries Verachtert <dries at ulyssis.org> - 1.1.12-1.2
 - Rebuild for Fedora Core 5.
 

Added: trunk/rpms/keepalived/keepalived.sysconfig
===================================================================
--- trunk/rpms/keepalived/keepalived.sysconfig	                        (rev 0)
+++ trunk/rpms/keepalived/keepalived.sysconfig	2007-02-06 13:18:58 UTC (rev 5138)
@@ -0,0 +1,15 @@
+# Options for keepalived. See `keepalived --help' output and keepalived(8) and
+# keepalived.conf(5) man pages for a list of all options. Here are the most
+# common ones :
+#
+# --vrrp               -P    Only run with VRRP subsystem.
+# --check              -C    Only run with Health-checker subsystem.
+# --dont-release-vrrp  -V    Dont remove VRRP VIPs & VROUTEs on daemon stop.
+# --dont-release-ipvs  -I    Dont remove IPVS topology on daemon stop.
+# --dump-conf          -d    Dump the configuration data.
+# --log-detail         -D    Detailed log messages.
+# --log-facility       -S    0-7 Set local syslog facility (default=LOG_DAEMON)
+#
+
+KEEPALIVED_OPTIONS="-D"
+



More information about the svn-commits mailing list