diff --git a/SOURCES/ipvsadm-fix-compile-warnings.patch b/SOURCES/ipvsadm-fix-compile-warnings.patch new file mode 100644 index 0000000..35f7617 --- /dev/null +++ b/SOURCES/ipvsadm-fix-compile-warnings.patch @@ -0,0 +1,27 @@ +--- ipvsadm.c.orig 2013-09-06 04:37:27.000000000 -0400 ++++ ipvsadm.c 2014-02-21 03:10:36.117000000 -0500 +@@ -1240,14 +1240,13 @@ + char *argv[] = { "/sbin/modprobe", "--", "ip_vs", NULL }; + int child; + int status; +- int rc; + + if (!(child = fork())) { + execv(argv[0], argv); + exit(1); + } + +- rc = waitpid(child, &status, 0); ++ waitpid(child, &status, 0); + + if (!WIFEXITED(status) || WEXITSTATUS(status)) { + return 1; +@@ -1429,7 +1428,7 @@ + static void print_largenum(unsigned long long i, unsigned int format) + { + char mytmp[32]; +- size_t len; ++ int len; + + if (format & FMT_EXACT) { + len = snprintf(mytmp, 32, "%llu", i); diff --git a/SOURCES/ipvsadm-show-backup-daemon.patch b/SOURCES/ipvsadm-show-backup-daemon.patch new file mode 100644 index 0000000..cb591f2 --- /dev/null +++ b/SOURCES/ipvsadm-show-backup-daemon.patch @@ -0,0 +1,33 @@ +From 8ca22ba019c0b4d72a54a0954fcc04848dba4579 Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara +Date: Tue, 20 May 2014 22:04:09 -0500 +Subject: [PATCH] ipvsadm: Fix list daemon to show backup daemon + +The list_daemon function in ipvsadm.c will show the master daemon +twice, but never the backup daemon. This patch replaces the redundant +check for IP_VS_STATE_MASTER with a check for IP_VS_STATE_BACKUP, then +prints the appropriate message. + +Signed-off-by: Ryan O'Hara +--- + ipvsadm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ipvsadm.c b/ipvsadm.c +index 4c83a8b..755827f 100644 +--- a/ipvsadm.c ++++ b/ipvsadm.c +@@ -1732,8 +1732,8 @@ static void list_daemon(void) + if (u[i].state & IP_VS_STATE_MASTER) + printf("master sync daemon (mcast=%s, syncid=%d)\n", + u[i].mcast_ifn, u[i].syncid); +- if (u[i].state & IP_VS_STATE_MASTER) +- printf("master sync daemon (mcast=%s, syncid=%d)\n", ++ if (u[i].state & IP_VS_STATE_BACKUP) ++ printf("backup sync daemon (mcast=%s, syncid=%d)\n", + u[i].mcast_ifn, u[i].syncid); + } + free(u); +-- +1.9.0 + diff --git a/SPECS/ipvsadm.spec b/SPECS/ipvsadm.spec index 00d9baf..9a63068 100644 --- a/SPECS/ipvsadm.spec +++ b/SPECS/ipvsadm.spec @@ -1,7 +1,7 @@ Name: ipvsadm Summary: Utility to administer the Linux Virtual Server Version: 1.27 -Release: 4%{?dist} +Release: 7%{?dist} License: GPLv2+ Group: Applications/System URL: https://kernel.org/pub/linux/utils/kernel/ipvsadm/ @@ -10,6 +10,9 @@ Source0: https://kernel.org/pub/linux/utils/kernel/ipvsadm/%{name}-%{version}.ta Source1: ipvsadm.service Source2: ipvsadm-config +Patch0: ipvsadm-show-backup-daemon.patch +Patch1: ipvsadm-fix-compile-warnings.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Buildrequires: libnl3-devel Buildrequires: popt-devel @@ -21,13 +24,24 @@ Requires(postun): systemd Requires(post): systemd-sysv %description -ipvsadm is a utility to administer the IP Virtual Server services -offered by the Linux kernel. +ipvsadm is used to setup, maintain, and inspect the virtual server +table in the Linux kernel. The Linux Virtual Server can be used to +build scalable network services based on a cluster of two or more +nodes. The active node of the cluster redirects service requests to a +collection of server hosts that will actually perform the +services. Supported Features include: + - two transport layer (layer-4) protocols (TCP and UDP) + - three packet-forwarding methods (NAT, tunneling, and direct routing) + - eight load balancing algorithms (round robin, weighted round robin, + least-connection, weighted least-connection, locality-based + least-connection, locality-based least-connection with + replication, destination-hashing, and source-hashing) %prep %setup -q - +%patch0 -p1 +%patch1 -p0 %build # Don't use _smp_mflags as it makes the build fail (1.2.4) @@ -35,18 +49,18 @@ CFLAGS="%{optflags}" make %install -rm -rf %{buildroot} -mkdir -p %{buildroot}/etc/rc.d/init.d -make install BUILD_ROOT=%{buildroot} MANDIR=%{_mandir} +%{__rm} -rf %{buildroot} +%{__mkdir_p} %{buildroot}/etc/rc.d/init.d +%{__make} install BUILD_ROOT=%{buildroot}%{_prefix} SBIN=%{buildroot}%{_sbindir} MANDIR=%{buildroot}%{_mandir} MAN=%{buildroot}%{_mandir}/man8 INIT=%{buildroot}%{_sysconfdir}/rc.d/init.d # Remove the provided init script -rm -f %{buildroot}/etc/rc.d/init.d/ipvsadm -install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/ipvsadm.service +%{__rm} -f %{buildroot}%{_sysconfdir}/rc.d/init.d/ipvsadm +%{__install} -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/ipvsadm.service # Install config file which controls the service behavior -install -D -p -m 0600 %{SOURCE2} %{buildroot}/etc/sysconfig/ipvsadm-config +%{__install} -D -p -m 0600 %{SOURCE2} %{buildroot}/etc/sysconfig/ipvsadm-config %clean -rm -rf %{buildroot} +%{__rm} -rf %{buildroot} %post @@ -70,19 +84,28 @@ rm -rf %{buildroot} /bin/systemctl try-restart ipvsadm.service >/dev/null 2>&1 || : %files -%defattr(-,root,root) +%defattr(-,root,root,-) %doc README %{_unitdir}/ipvsadm.service %config(noreplace) /etc/sysconfig/ipvsadm-config -/sbin/ipvsadm -/sbin/ipvsadm-restore -/sbin/ipvsadm-save +%{_sbindir}/ipvsadm +%{_sbindir}/ipvsadm-restore +%{_sbindir}/ipvsadm-save %{_mandir}/man8/ipvsadm.8* %{_mandir}/man8/ipvsadm-restore.8* %{_mandir}/man8/ipvsadm-save.8* %changelog +* Tue Sep 30 2014 Ryan O'Hara - 1.27-7 +- Improve package description (#1067144) + +* Tue Sep 30 2014 Ryan O'Hara - 1.27-6 +- Cleanup specfile and install to _sbindir (#1067674) + +* Tue Jul 08 2014 Ryan O'Hara - 1.27-5 +- Fix list_daemon to show backup daemon (#1099689) + * Mon Jan 27 2014 Ryan O'Hara - 1.27-4 - Link with libnl3 (#1054970) @@ -197,10 +220,10 @@ rm -rf %{buildroot} * Fri Jun 13 2003 Mike McLean 1.21-8 - dropping ppc from excluded arches -* Thu Apr 4 2003 Mike McLean 1.21-7 +* Fri Apr 4 2003 Mike McLean 1.21-7 - changing %%ExcludeArch -* Thu Apr 4 2003 Mike McLean 1.21-6 +* Fri Apr 4 2003 Mike McLean 1.21-6 - added BuildRequires: kernel-source - escaped all %% characters in %%changelog @@ -212,7 +235,7 @@ rm -rf %{buildroot} - Argh,.. %%docdir was defined which overrode what I'd intended to happen -* Tue Aug 1 2002 Philip Copeland +* Thu Aug 1 2002 Philip Copeland - Ah... the manuals were being pushed into /usr/man instead of /usr/share/man. Fixed. @@ -220,17 +243,17 @@ rm -rf %{buildroot} - Minor Makefile tweak so that we do a minimal hunt for to find the ip_vs.h file location -* Thu Dec 16 2001 Wensong Zhang +* Sun Dec 16 2001 Wensong Zhang - Changed to install ipvsadm man pages according to the %%{_mandir} -* Thu Dec 30 2000 Wensong Zhang +* Sat Dec 30 2000 Wensong Zhang - update the %%file section -* Thu Dec 17 2000 Wensong Zhang +* Sun Dec 17 2000 Wensong Zhang - Added a if-condition to keep both new or old rpm utility building the package happily. -* Tue Dec 12 2000 P.opeland +* Tue Dec 12 2000 P.Copeland - Small modifications to make the compiler happy in RH7 and the Alpha - Fixed the documentation file that got missed off in building the rpm