diff --git a/.corosync.metadata b/.corosync.metadata index 98110dc..b2ed6f2 100644 --- a/.corosync.metadata +++ b/.corosync.metadata @@ -1 +1,2 @@ -306ad7c9418fa727e8ef33aecbb2edc07bf3be66 SOURCES/corosync-3.0.0.tar.gz +7c0c4156efb6625d8eb5be3999275769d3c63890 SOURCES/corosync-3.0.2.tar.gz +3c1904b844ec7e1b96f47ef92e4da2d99441c5f0 SOURCES/spausedd-20190320.tar.gz diff --git a/.gitignore b/.gitignore index 66ae3cf..b0fcd13 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -SOURCES/corosync-3.0.0.tar.gz +SOURCES/corosync-3.0.2.tar.gz +SOURCES/spausedd-20190320.tar.gz diff --git a/SOURCES/bz1665211-1-totemip-Use-AF_UNSPEC-for-ipv4-6-and-ipv6-4.patch b/SOURCES/bz1665211-1-totemip-Use-AF_UNSPEC-for-ipv4-6-and-ipv6-4.patch deleted file mode 100644 index 0330803..0000000 --- a/SOURCES/bz1665211-1-totemip-Use-AF_UNSPEC-for-ipv4-6-and-ipv6-4.patch +++ /dev/null @@ -1,234 +0,0 @@ -From 2ab4d4188670356dcb82a80f2fc4598f5145c77d Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Thu, 10 Jan 2019 15:06:20 +0100 -Subject: [PATCH] totemip: Use AF_UNSPEC for ipv4-6 and ipv6-4 - -AF_UNSPEC returns different results than AF_INET/AF_INET6, because of -nsswitch.conf search is in order and it stops asking other -modules once current module success. - -Example of difference between previous and new code when ipv6-4 is used: -- /etc/hosts contains test_name with an ipv4 -- previous code called AF_INET6 where /etc/hosts failed so other methods -were used which may return IPv6 addr -> result was ether fail or IPv6 -address. -- new code calls AF_UNSPEC returning IPv4 defined in /etc/hosts -> -result is IPv4 address - -New code behavior should solve problems caused by nss-myhostname. - -Signed-off-by: Jan Friesse -Reviewed-by: Fabio M. Di Nitto ---- - exec/totemip.c | 106 +++++++++++++++++++++++++++----------- - include/corosync/totem/totemip.h | 6 +- - man/corosync.conf.5 | 8 ++- - 3 files changed, 83 insertions(+), 37 deletions(-) - -diff --git a/exec/totemip.c b/exec/totemip.c -index 9d96e1b..36d0a72 100644 ---- a/exec/totemip.c -+++ b/exec/totemip.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2005-2011 Red Hat, Inc. -+ * Copyright (c) 2005-2019 Red Hat, Inc. - * - * All rights reserved. - * -@@ -288,69 +288,113 @@ int totemip_parse(struct totem_ip_address *totemip, const char *addr, - enum totem_ip_version_enum ip_version) - { - struct addrinfo *ainfo; -+ struct addrinfo *ainfo_iter; -+ struct addrinfo *ainfo_ipv4; -+ struct addrinfo *ainfo_ipv6; -+ struct addrinfo *ainfo_final; - struct addrinfo ahints; - struct sockaddr_in *sa; - struct sockaddr_in6 *sa6; - int ret; - int debug_ip_family; -- int ai_family1, ai_family2; -+ int ai_family; - - memset(&ahints, 0, sizeof(ahints)); - ahints.ai_socktype = SOCK_DGRAM; - ahints.ai_protocol = IPPROTO_UDP; - -- ai_family1 = ai_family2 = -1; -+ ai_family = AF_UNSPEC; -+ debug_ip_family = 0; - - switch (ip_version) { - case TOTEM_IP_VERSION_4: -- ai_family1 = AF_INET; -+ ai_family = AF_INET; -+ debug_ip_family = 4; - break; - case TOTEM_IP_VERSION_6: -- ai_family1 = AF_INET6; -- break; -- case TOTEM_IP_VERSION_4_6: -- ai_family1 = AF_INET; -- ai_family2 = AF_INET6; -+ ai_family = AF_INET6; -+ debug_ip_family = 6; - break; - case TOTEM_IP_VERSION_6_4: -- ai_family1 = AF_INET6; -- ai_family2 = AF_INET; -+ case TOTEM_IP_VERSION_4_6: -+ /* -+ * ai_family and debug_ip_family are already set correctly -+ */ - break; - } - -- ahints.ai_family = ai_family1; -+ ahints.ai_family = ai_family; -+ - ret = getaddrinfo(addr, NULL, &ahints, &ainfo); -- if (ret && ai_family2 != -1) { -- ahints.ai_family = ai_family2; -- ret = getaddrinfo(addr, NULL, &ahints, &ainfo); -- } - -- debug_ip_family = 4; -- if (ahints.ai_family == AF_INET6) { -- debug_ip_family = 6; -- } -+ if (ret == 0 && ai_family == AF_UNSPEC) { -+ ainfo_ipv4 = ainfo_ipv6 = NULL; - -- if (ret) { -- log_printf (LOGSYS_LEVEL_DEBUG, "totemip_parse: IPv%u address of %s not resolvable", -- debug_ip_family, addr); -+ /* -+ * Walk thru results and store first AF_INET and AF_INET6 -+ */ -+ for (ainfo_iter = ainfo; ainfo_iter != NULL; ainfo_iter = ainfo_iter->ai_next) { -+ if (ainfo_iter->ai_family == AF_INET && ainfo_ipv4 == NULL) { -+ ainfo_ipv4 = ainfo_iter; -+ } - -- return -1; -+ if (ainfo_iter->ai_family == AF_INET6 && ainfo_ipv6 == NULL) { -+ ainfo_ipv6 = ainfo_iter; -+ } -+ } -+ -+ if (ip_version == TOTEM_IP_VERSION_6_4) { -+ if (ainfo_ipv6 != NULL) { -+ ainfo_final = ainfo_ipv6; -+ } else { -+ ainfo_final = ainfo_ipv4; -+ } -+ } else { -+ if (ainfo_ipv4 != NULL) { -+ ainfo_final = ainfo_ipv4; -+ } else { -+ ainfo_final = ainfo_ipv6; -+ } -+ } -+ } else if (ret == 0) { -+ ainfo_final = ainfo; -+ } else { -+ ainfo_final = NULL; - } - -- sa = (struct sockaddr_in *)ainfo->ai_addr; -- sa6 = (struct sockaddr_in6 *)ainfo->ai_addr; -- totemip->family = ainfo->ai_family; -+ if (ainfo_final == NULL) { -+ if (ret == 0) { -+ freeaddrinfo(ainfo); -+ } -+ -+ if (debug_ip_family == 0) { -+ log_printf(LOGSYS_LEVEL_DEBUG, "totemip_parse: IP address of %s not resolvable", -+ addr); -+ } else { -+ log_printf(LOGSYS_LEVEL_DEBUG, "totemip_parse: IPv%u address of %s not resolvable", -+ debug_ip_family, addr); -+ } -+ -+ return (-1); -+ } - -- if (ainfo->ai_family == AF_INET) -+ totemip->family = ainfo_final->ai_family; -+ if (ainfo_final->ai_family == AF_INET) { -+ sa = (struct sockaddr_in *)ainfo_final->ai_addr; - memcpy(totemip->addr, &sa->sin_addr, sizeof(struct in_addr)); -- else -+ debug_ip_family = 4; -+ } else { -+ sa6 = (struct sockaddr_in6 *)ainfo_final->ai_addr; - memcpy(totemip->addr, &sa6->sin6_addr, sizeof(struct in6_addr)); -+ debug_ip_family = 6; -+ } - -- log_printf (LOGSYS_LEVEL_DEBUG, "totemip_parse: IPv%u address of %s resolved as %s", -+ log_printf(LOGSYS_LEVEL_DEBUG, "totemip_parse: IPv%u address of %s resolved as %s", - debug_ip_family, addr, totemip_print(totemip)); - - freeaddrinfo(ainfo); -- return 0; -+ -+ return (0); - } - - /* Make a sockaddr_* into a totem_ip_address */ -diff --git a/include/corosync/totem/totemip.h b/include/corosync/totem/totemip.h -index de22461..b8da3c9 100644 ---- a/include/corosync/totem/totemip.h -+++ b/include/corosync/totem/totemip.h -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2005-2010 Red Hat, Inc. -+ * Copyright (c) 2005-2019 Red Hat, Inc. - * - * All rights reserved. - * -@@ -70,8 +70,8 @@ struct totem_ip_address - enum totem_ip_version_enum { - TOTEM_IP_VERSION_4, /* Use only AF_INET */ - TOTEM_IP_VERSION_6, /* Use only AF_INET6 */ -- TOTEM_IP_VERSION_4_6, /* Use AF_INET and if it fails, use AF_INET6 */ -- TOTEM_IP_VERSION_6_4 /* Use AF_INET6 and if it fails, use AF_INET */ -+ TOTEM_IP_VERSION_4_6, /* Use AF_UNSPEC and filter result preferring AF_INET */ -+ TOTEM_IP_VERSION_6_4 /* Use AF_UNSPEC and filter result preferring AF_INET6 */ - }; - - struct totem_ip_if_address -diff --git a/man/corosync.conf.5 b/man/corosync.conf.5 -index 790f434..0e752bc 100644 ---- a/man/corosync.conf.5 -+++ b/man/corosync.conf.5 -@@ -32,7 +32,7 @@ - .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - .\" * THE POSSIBILITY OF SUCH DAMAGE. - .\" */ --.TH COROSYNC_CONF 5 2018-12-14 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual" -+.TH COROSYNC_CONF 5 2019-01-10 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual" - .SH NAME - corosync.conf - corosync executive configuration file - -@@ -314,9 +314,11 @@ The value can be one of - (check only IPv6 address) - , - .B ipv4-6 --(first check IPv4 address, if that fails then look for an IPv6 address) and -+(look for all address families and use first IPv4 address found in the list if there is such address, -+otherwise use first IPv6 address) and - .B ipv6-4 --(first check IPv6 address, if that fails then look for an IPv4 address). -+(look for all address families and use first IPv6 address found in the list if there is such address, -+otherwise use first IPv4 address). - - Default (if unspecified) is ipv6-4 for knet and udpu transports and ipv4 for udp. - --- -1.7.1 - diff --git a/SPECS/corosync.spec b/SPECS/corosync.spec index 84b491b..c5cb6f6 100644 --- a/SPECS/corosync.spec +++ b/SPECS/corosync.spec @@ -7,20 +7,33 @@ %bcond_without dbus %bcond_without systemd %bcond_without xmlconf +%bcond_without nozzle +%bcond_without vqsim %bcond_without runautogen +%bcond_without userflags +%bcond_without spausedd %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}} %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}} +%if %{with spausedd} +%global spausedd_version 20190320 +%endif + Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 3.0.0 -Release: 2%{?gitver}%{?dist} +Version: 3.0.2 +Release: 3%{?gitver}%{?dist} License: BSD URL: http://corosync.github.io/corosync/ Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz - -Patch0: bz1665211-1-totemip-Use-AF_UNSPEC-for-ipv4-6-and-ipv6-4.patch +%if %{with spausedd} +Source1: https://github.com/jfriesse/spausedd/releases/download/%{spausedd_version}/spausedd-%{spausedd_version}.tar.gz +# VMGuestLib exists only for x86_64 architecture +%ifarch x86_64 +%global use_vmguestlib 1 +%endif +%endif # Runtime bits # The automatic dependency overridden in favor of explicit version lock @@ -47,6 +60,9 @@ BuildRequires: net-snmp-devel %if %{with dbus} BuildRequires: dbus-devel %endif +%if %{with nozzle} +BuildRequires: libnozzle1-devel +%endif %if %{with systemd} %{?systemd_requires} BuildRequires: systemd @@ -58,10 +74,19 @@ Requires(preun): /sbin/chkconfig %if %{with xmlconf} Requires: libxslt %endif +%if %{with vqsim} +BuildRequires: readline-devel +%endif +%if %{defined use_vmguestlib} +BuildRequires: pkgconfig(vmguestlib) +%endif %prep +%if %{with spausedd} +%setup -q -a 1 -n %{name}-%{version}%{?gittarver} +%else %setup -q -n %{name}-%{version}%{?gittarver} -%patch0 -p1 -b .bz1665211-1 +%endif %build %if %{with runautogen} @@ -87,12 +112,33 @@ Requires: libxslt %if %{with xmlconf} --enable-xmlconf \ %endif +%if %{with nozzle} + --enable-nozzle \ +%endif +%if %{with vqsim} + --enable-vqsim \ +%endif +%if %{with userflags} + --enable-user-flags \ +%endif --with-initddir=%{_initrddir} \ --with-systemddir=%{_unitdir} \ --docdir=%{_docdir} make %{_smp_mflags} +%if %{with spausedd} +cd spausedd-%{spausedd_version} +CFLAGS="${CFLAGS:-%{optflags}}" ; export CFLAGS +make \ +%if %{defined use_vmguestlib} + WITH_VMGUESTLIB=1 \ +%else + WITH_VMGUESTLIB=0 \ +%endif + %{?_smp_mflags} +%endif + %install make install DESTDIR=%{buildroot} @@ -115,6 +161,21 @@ install -m 644 tools/corosync-notifyd.sysconfig.example \ install -m 644 init/corosync.sysconfig.example \ %{buildroot}%{_sysconfdir}/sysconfig/corosync +%if %{with spausedd} +cd spausedd-%{spausedd_version} +make DESTDIR="%{buildroot}" PREFIX="%{_prefix}" install + +%if %{with systemd} +mkdir -p %{buildroot}/%{_unitdir} +install -m 644 -p init/spausedd.service %{buildroot}/%{_unitdir} +%else +mkdir -p %{buildroot}/%{_initrddir} +install -m 755 -p init/spausedd %{buildroot}/%{_initrddir} +%endif + +cd .. +%endif + %description This package contains the Corosync Cluster Engine Executive, several default APIs and libraries, default configuration files, and an init script. @@ -252,7 +313,106 @@ The Corosync Cluster Engine APIs. %{_mandir}/man3/sam_*3* %{_mandir}/man3/cmap_*3* +%if %{with vqsim} +%package -n corosync-vqsim +Summary: The Corosync Cluster Engine - Votequorum Simulator +Requires: corosynclib%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n corosync-vqsim +A command-line simulator for the corosync votequorum subsystem. +It uses the same code as the corosync quorum system but forks +them into subprocesses to simulate nodes. +Nodes can be added and removed as well as partitioned (to simulate +network splits) + +%files -n corosync-vqsim +%doc LICENSE +%{_bindir}/corosync-vqsim +%{_mandir}/man8/corosync-vqsim.8* +%endif + +# optional spausedd +%if %{with spausedd} + +%package -n spausedd +Summary: Utility to detect and log scheduler pause +URL: https://github.com/jfriesse/spausedd + +%if %{with systemd} +%{?systemd_requires} +%else +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +%endif + +%description -n spausedd +Utility to detect and log scheduler pause + +%files -n spausedd +%doc spausedd-%{spausedd_version}/AUTHORS spausedd-%{spausedd_version}/COPYING +%{_bindir}/spausedd +%{_mandir}/man8/spausedd* +%if %{with systemd} +%{_unitdir}/spausedd.service +%else +%{_initrddir}/spausedd +%endif + +%post -n spausedd +%if %{with systemd} && 0%{?systemd_post:1} +%systemd_post spausedd.service +%else +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add spausedd || : +fi +%endif + +%preun -n spausedd +%if %{with systemd} && 0%{?systemd_preun:1} +%systemd_preun spausedd.service +%else +if [ $1 -eq 0 ]; then + /sbin/service spausedd stop &>/dev/null || : + /sbin/chkconfig --del spausedd || : +fi +%endif + +%postun -n spausedd +%if %{with systemd} && 0%{?systemd_postun:1} + %systemd_postun spausedd.service +%endif + +%endif + %changelog +* Tue Aug 06 2019 Jan Friesse - 3.0.2-3 +- Resolves: rhbz#1738218 + +- Do not set exec permission for service file +- Fix CFLAGS definition + +* Thu Jun 13 2019 Jan Friesse 3.0.2-2 +- Related: rhbz#1679656 + +- Improve spausedd test + +* Wed Jun 12 2019 Jan Friesse 3.0.2-1 +- Resolves: rhbz#1705591 +- Resolves: rhbz#1688889 + +* Mon May 13 2019 Jan Friesse 3.0.0-4 +- Related: rhbz#1679656 + +- Really add gating + +* Mon May 13 2019 Jan Friesse 3.0.0-3 +- Resolves: rhbz#1691401 +- Related: rhbz#1679656 + +- Add spausedd subpackage +- Add gating tests + * Fri Jan 11 2019 Jan Friesse 3.0.0-2 - Resolves: rhbz#1665211 @@ -269,7 +429,7 @@ The Corosync Cluster Engine APIs. - man: Add some information about address resolution (rhbz#1654630) - merge upstream commit 8d50bd946dd7e01da75f06da3f885e7dc82f4f12 (rhbz#1654630) -- config: Look up hostnames in a defined order (rhbz#1654630) +- config: Look up hostnames in a defined order (rhbz#1654630) - merge upstream commit 3d7f136f86a56dd9d9caa9060f7a01e8b681eb7f (rhbz#1654630) * Fri Dec 7 2018 Jan Friesse - 2.99.5-1