From f3fa54cd08e24f30edeb630d97e56d234bc839f185a673ceb2dd376ddd4d9351 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Mon, 31 Jul 2017 03:05:03 +0000 Subject: [PATCH 1/7] Accepting request 513099 from home:BinLiu:branches:network:ha-clustering:Factory - make corosync.spec uniform (bsc#1051385) Modified: corosync.spec 1. there are some lines are commented in corosync.spec, will define new macro to make these lines uncommented 2. in former, xmlconf, rdma and snmp were disabled, these features are wrongly enabled, will disable them OBS-URL: https://build.opensuse.org/request/show/513099 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=96 --- corosync.changes | 8 ++++++ corosync.spec | 64 +++++++++++++++++------------------------------- 2 files changed, 31 insertions(+), 41 deletions(-) diff --git a/corosync.changes b/corosync.changes index 3f95f07..e113e6a 100644 --- a/corosync.changes +++ b/corosync.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jul 31 02:54:49 UTC 2017 - bliu@suse.com + +- make corosync.spec uniform (bsc#1051385) +Modified: corosync.spec + 1. there are some lines are commented in corosync.spec, will define new macro to make these lines uncommented + 2. in former, xmlconf, rdma and snmp were disabled, these features are wrongly enabled, will disable them + ------------------------------------------------------------------- Wed Jul 12 05:25:45 UTC 2017 - bliu@suse.com diff --git a/corosync.spec b/corosync.spec index 189a4bb..7650fba 100644 --- a/corosync.spec +++ b/corosync.spec @@ -23,15 +23,16 @@ # to disable or enable specific features %define with_testagents 1 %define with_watchdog 1 -#%define with_monitoring 0 -%define with_snmp 1 -#%define with_dbus 1 -%define with_rdma 1 +%define with_monitoring 0 +%define with_snmp 0 +%define with_dbus 0 +%define with_rdma 0 %define with_systemd 1 -%define with_xmlconf 1 +%define with_xmlconf 0 %define with_runautogen 1 %define with_qdevices 1 %define with_qnetd 1 +%define with_upstart 0 %if 0%{?sles_version} == 12 %ifnarch s390 s390x %define buildib 1 @@ -47,7 +48,6 @@ License: BSD-3-Clause Group: Productivity/Clustering/HA Version: 2.4.2 Release: 0 -#Release: 1%{?gitver}%{?dist} Url: http://corosync.github.io/corosync/ Source0: %{name}-%{version}.tar.gz Source2: baselibs.conf @@ -96,9 +96,9 @@ BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool %endif -#%if %{with monitoring} -#BuildRequires: libstatgrab-devel -#%endif +%if %{with_monitoring} +BuildRequires: libstatgrab-devel +%endif %if %{with_rdma} BuildRequires: libibverbs-devel BuildRequires: librdmacm-devel @@ -106,9 +106,9 @@ BuildRequires: librdmacm-devel %if %{with_snmp} BuildRequires: net-snmp-devel %endif -#%if %{with dbus} -#BuildRequires: dbus-1-devel -#%endif +%if %{with_dbus} +BuildRequires: dbus-1-devel +%endif %if %{with_systemd} BuildRequires: pkgconfig(systemd) Requires(post): systemd @@ -197,10 +197,10 @@ rm -rf %{buildroot} make install DESTDIR=%{buildroot} -#%if %{with dbus} -#mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d -#install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf -#%endif +%if %{with_dbus} +mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d +install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf +%endif %if %{with_systemd} ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rccorosync %endif @@ -219,33 +219,25 @@ install -m 0644 tools/corosync-notifyd.sysconfig.example %{buildroot}/usr/lib/t install -m 0644 conf/corosync.conf.example* %{buildroot}/usr/share/doc/packages/corosync/ rm -rf %{buildroot}/etc/corosync/corosync.conf.example* rm -rf %{buildroot}/etc/logrotate.d/ -# /etc/sysconfig/corosync-notifyd mkdir -p %{buildroot}%{_sysconfdir}/sysconfig install -m 644 tools/corosync-notifyd.sysconfig.example \ %{buildroot}/usr/lib/tmpfiles.d/corosync-notifyd -# %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd -# /etc/sysconfig/corosync install -m 644 init/corosync.sysconfig.example \ %{buildroot}/var/adm/fillup-templates/sysconfig.corosync -# %{buildroot}%{_sysconfdir}/sysconfig/corosync #add init scripts for corosync, corosync-qdevice, corosync-qnetd install -m 755 init/corosync %{buildroot}%{_sysconfdir}/init.d/corosync install -m 755 init/corosync-qdevice %{buildroot}%{_sysconfdir}/init.d/corosync-qdevice install -m 755 init/corosync-qnetd %{buildroot}%{_sysconfdir}/init.d/corosync-qnetd rm -rf %{buildroot}%{localstatedir}/run/ %if %{with_qdevices} -# /etc/sysconfig/corosync-qdevice install -m 644 init/corosync-qdevice.sysconfig.example \ %{buildroot}/var/adm/fillup-templates/sysconfig.corosync-qdevice -# %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice install -m 770 -d %{buildroot}/run/corosync-qdevice %endif %if %{with_qnetd} -# /etc/sysconfig/corosync-qnetd install -m 644 init/corosync-qnetd.sysconfig.example \ %{buildroot}/var/adm/fillup-templates/sysconfig.corosync-qnetd -# %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd install -m 770 -d %{buildroot}/run/corosync-qnetd %if %{with_systemd} sed -i -e 's/^#User=/User=/' \ @@ -267,7 +259,6 @@ APIs and libraries, default configuration files, and an init script. %pre %if %{with_systemd} -#%service_add_pre corosync.service corosync-notifyd.service #we do not use corosync-notifyd.service %service_add_pre corosync.service %endif @@ -275,7 +266,6 @@ APIs and libraries, default configuration files, and an init script. %post %{fillup_and_insserv -n corosync} %if %{with_systemd} -#%service_add_post corosync.service corosync-notifyd.service #we do not use corosync-notifyd.service %service_add_post corosync.service %endif @@ -331,13 +321,11 @@ fi %config(noreplace) /usr/share/doc/packages/corosync/corosync.conf.example %config(noreplace) /usr/share/doc/packages/corosync/corosync.conf.example.udpu %config(noreplace) /usr/lib/tmpfiles.d/corosync-notifyd -#%config(noreplace) %{_sysconfdir}/sysconfig/corosync %config(noreplace) /var/adm/fillup-templates/sysconfig.corosync -#%config(noreplace) %{_sysconfdir}/logrotate.d/corosync -#%if %{with dbus} -#%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf -#%endif +%if %{with_dbus} +%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf +%endif %if %{with_snmp} %{_datadir}/snmp/mibs/COROSYNC-MIB.txt %endif @@ -351,10 +339,10 @@ fi %{_initrddir}/corosync %{_initrddir}/corosync-notifyd %endif -#%if %{with_upstart} -#%{_sysconfdir}/init/corosync.conf -#%{_sysconfdir}/init/corosync-notifyd.conf -#%endif +%if %{with_upstart} +%{_sysconfdir}/init/corosync.conf +%{_sysconfdir}/init/corosync-notifyd.conf +%endif %dir %{_localstatedir}/lib/corosync %dir %{_localstatedir}/log/cluster %{_mandir}/man8/corosync_overview.8* @@ -536,13 +524,11 @@ fi %dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net #change corosync-qdevice to /run as /var/run is symlink nowdays %ghost /run/corosync-qdevice -#%dir %{_localstatedir}/run/corosync-qdevice %{_sbindir}/corosync-qdevice %{_sbindir}/corosync-qdevice-net-certutil %{_sbindir}/corosync-qdevice-tool %{_sysconfdir}/init.d/corosync-qdevice %config(noreplace) /var/adm/fillup-templates/sysconfig.corosync-qdevice -#%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice %if %{with_systemd} %{_unitdir}/corosync-qdevice.service %dir %{_datadir}/corosync @@ -583,8 +569,6 @@ getent passwd coroqnetd >/dev/null || \ exit 0 %post -n corosync-qnetd -#mkdir -m 770 /run/corosync-qnetd -#chown coroqnetd:coroqnetd /run/corosync-qnetd %if %{sles_version} > 0 ln -s /run/corosync-qnetd /var/run/ %endif @@ -619,13 +603,11 @@ fi %dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd #change corosync-qnetd to /run as /var/run is just symlink nowadays %ghost %attr(770, coroqnetd, coroqnetd) /run/corosync-qnetd -#%dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd %{_bindir}/corosync-qnetd %{_bindir}/corosync-qnetd-certutil %{_bindir}/corosync-qnetd-tool %{_sysconfdir}/init.d/corosync-qnetd %config(noreplace) /var/adm/fillup-templates/sysconfig.corosync-qnetd -#%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd %if %{with_systemd} %{_unitdir}/corosync-qnetd.service %dir %{_datadir}/corosync From a5f333fb1d0b4d21b1cd87e23576c9c193072bd2ace81140995a1d003ebe0ea9 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Thu, 3 Aug 2017 03:20:08 +0000 Subject: [PATCH 2/7] Accepting request 514133 from home:BinLiu:branches:network:ha-clustering:Factory - L3: corosync: assert(sender_node != NULL) fails after tearing down a network interface(bsc#1032634) Added: 0010-fix-ifdown-udp.patch - some errors in spec file(bsc#1047862) Modified:corosync.spec 1) as in openSUSE:factory, there are %define, but bcond_with coudld be toggled by osc command , change %define to %bcond_with and %bcond_without 2) change service_del_postun to service_del_preun, since service_del_postun is not a right macro OBS-URL: https://build.opensuse.org/request/show/514133 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=97 --- 0010-fix-ifdown-udp.patch | 370 ++++++++++++++++++++++++++++++++++++++ corosync.changes | 15 ++ corosync.spec | 175 ++++++++---------- 3 files changed, 462 insertions(+), 98 deletions(-) create mode 100644 0010-fix-ifdown-udp.patch diff --git a/0010-fix-ifdown-udp.patch b/0010-fix-ifdown-udp.patch new file mode 100644 index 0000000..f23bb4d --- /dev/null +++ b/0010-fix-ifdown-udp.patch @@ -0,0 +1,370 @@ +From 790794bc1f654fd1b4c8c2904c8d5c60374b99c1 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Mon, 31 Jul 2017 18:05:18 +0200 +Subject: [PATCH] totemudp: Add local loop support for unicast msgs + +This patch intends to solve long time ifdown corosync problem. Idea is +to use multicast local socket also for sending unicast messages. +Together with testing what is current bind state it's possible to keep +pretending existence of old IP address instead of rebinding to localhost +what breaks a lot things badly. + +Heavilly based on Yu, Zou work. Also big thanks +to Bin Liu for testing and bringing some ideas. + +Signed-off-by: Jan Friesse +--- + exec/totemudp.c | 215 +++++++++++++++++++++++++++++++++----------------------- + 1 file changed, 128 insertions(+), 87 deletions(-) + +diff --git a/exec/totemudp.c b/exec/totemudp.c +index 31d05704..47830e4b 100644 +--- a/exec/totemudp.c ++++ b/exec/totemudp.c +@@ -207,8 +207,6 @@ static int totemudp_build_sockets ( + struct totemudp_socket *sockets, + struct totem_ip_address *bound_to); + +-static struct totem_ip_address localhost; +- + static void totemudp_instance_initialize (struct totemudp_instance *instance) + { + memset (instance, 0, sizeof (struct totemudp_instance)); +@@ -269,6 +267,7 @@ static inline void ucast_sendmsg ( + struct sockaddr_storage sockaddr; + struct iovec iovec; + int addrlen; ++ int send_sock; + + /* + * Encrypt and digest the message +@@ -313,11 +312,19 @@ static inline void ucast_sendmsg ( + #endif + + ++ if (instance->netif_bind_state == BIND_STATE_REGULAR) { ++ send_sock = instance->totemudp_sockets.mcast_send; ++ } else { ++ send_sock = instance->totemudp_sockets.local_mcast_loop[1]; ++ msg_ucast.msg_name = NULL; ++ msg_ucast.msg_namelen = 0; ++ } ++ + /* + * Transmit unicast message + * An error here is recovered by totemsrp + */ +- res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_ucast, ++ res = sendmsg (send_sock, &msg_ucast, + MSG_NOSIGNAL); + if (res < 0) { + LOGSYS_PERROR (errno, instance->totemudp_log_level_debug, +@@ -380,18 +387,20 @@ static inline void mcast_sendmsg ( + msg_mcast.msg_accrightslen = 0; + #endif + +- /* +- * Transmit multicast message +- * An error here is recovered by totemsrp +- */ +- res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast, +- MSG_NOSIGNAL); +- if (res < 0) { +- LOGSYS_PERROR (errno, instance->totemudp_log_level_debug, +- "sendmsg(mcast) failed (non-critical)"); +- instance->stats->continuous_sendmsg_failures++; +- } else { +- instance->stats->continuous_sendmsg_failures = 0; ++ if (instance->netif_bind_state == BIND_STATE_REGULAR) { ++ /* ++ * Transmit multicast message ++ * An error here is recovered by totemsrp ++ */ ++ res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast, ++ MSG_NOSIGNAL); ++ if (res < 0) { ++ LOGSYS_PERROR (errno, instance->totemudp_log_level_debug, ++ "sendmsg(mcast) failed (non-critical)"); ++ instance->stats->continuous_sendmsg_failures++; ++ } else { ++ instance->stats->continuous_sendmsg_failures = 0; ++ } + } + + /* +@@ -556,7 +565,6 @@ static void timer_function_netif_check_timeout ( + struct totemudp_instance *instance = (struct totemudp_instance *)data; + int interface_up; + int interface_num; +- struct totem_ip_address *bind_address; + + /* + * Build sockets for every interface +@@ -593,28 +601,31 @@ static void timer_function_netif_check_timeout ( + qb_loop_poll_del (instance->totemudp_poll_handle, + instance->totemudp_sockets.mcast_recv); + close (instance->totemudp_sockets.mcast_recv); ++ instance->totemudp_sockets.mcast_recv = -1; + } + if (instance->totemudp_sockets.mcast_send > 0) { + close (instance->totemudp_sockets.mcast_send); +- } +- if (instance->totemudp_sockets.local_mcast_loop[0] > 0) { +- qb_loop_poll_del (instance->totemudp_poll_handle, +- instance->totemudp_sockets.local_mcast_loop[0]); +- close (instance->totemudp_sockets.local_mcast_loop[0]); +- close (instance->totemudp_sockets.local_mcast_loop[1]); ++ instance->totemudp_sockets.mcast_send = -1; + } + if (instance->totemudp_sockets.token > 0) { + qb_loop_poll_del (instance->totemudp_poll_handle, + instance->totemudp_sockets.token); + close (instance->totemudp_sockets.token); ++ instance->totemudp_sockets.token = -1; + } + + if (interface_up == 0) { ++ if (instance->netif_bind_state == BIND_STATE_UNBOUND) { ++ log_printf (instance->totemudp_log_level_error, ++ "One of your ip addresses are now bound to localhost. " ++ "Corosync would not work correctly."); ++ exit(COROSYNC_DONE_FATAL_ERR); ++ } ++ + /* + * Interface is not up + */ + instance->netif_bind_state = BIND_STATE_LOOPBACK; +- bind_address = &localhost; + + /* + * Add a timer to retry building interfaces and request memb_gather_enter +@@ -630,34 +641,29 @@ static void timer_function_netif_check_timeout ( + * Interface is up + */ + instance->netif_bind_state = BIND_STATE_REGULAR; +- bind_address = &instance->totem_interface->bindnet; + } + /* + * Create and bind the multicast and unicast sockets + */ + (void)totemudp_build_sockets (instance, + &instance->mcast_address, +- bind_address, ++ &instance->totem_interface->bindnet, + &instance->totemudp_sockets, + &instance->totem_interface->boundto); + +- qb_loop_poll_add ( +- instance->totemudp_poll_handle, +- QB_LOOP_MED, +- instance->totemudp_sockets.mcast_recv, +- POLLIN, instance, net_deliver_fn); +- +- qb_loop_poll_add ( +- instance->totemudp_poll_handle, +- QB_LOOP_MED, +- instance->totemudp_sockets.local_mcast_loop[0], +- POLLIN, instance, net_deliver_fn); ++ if (instance->netif_bind_state == BIND_STATE_REGULAR) { ++ qb_loop_poll_add ( ++ instance->totemudp_poll_handle, ++ QB_LOOP_MED, ++ instance->totemudp_sockets.mcast_recv, ++ POLLIN, instance, net_deliver_fn); + +- qb_loop_poll_add ( +- instance->totemudp_poll_handle, +- QB_LOOP_MED, +- instance->totemudp_sockets.token, +- POLLIN, instance, net_deliver_fn); ++ qb_loop_poll_add ( ++ instance->totemudp_poll_handle, ++ QB_LOOP_MED, ++ instance->totemudp_sockets.token, ++ POLLIN, instance, net_deliver_fn); ++ } + + totemip_copy (&instance->my_id, &instance->totem_interface->boundto); + +@@ -708,6 +714,66 @@ static void totemudp_traffic_control_set(struct totemudp_instance *instance, int + #endif + } + ++static int totemudp_build_local_sockets( ++ struct totemudp_instance *instance, ++ struct totemudp_socket *sockets) ++{ ++ int i; ++ unsigned int sendbuf_size; ++ unsigned int recvbuf_size; ++ unsigned int optlen = sizeof (sendbuf_size); ++ int res; ++ ++ /* ++ * Create local multicast loop socket ++ */ ++ if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sockets->local_mcast_loop) == -1) { ++ LOGSYS_PERROR (errno, instance->totemudp_log_level_warning, ++ "socket() failed"); ++ return (-1); ++ } ++ ++ for (i = 0; i < 2; i++) { ++ totemip_nosigpipe (sockets->local_mcast_loop[i]); ++ res = fcntl (sockets->local_mcast_loop[i], F_SETFL, O_NONBLOCK); ++ if (res == -1) { ++ LOGSYS_PERROR (errno, instance->totemudp_log_level_warning, ++ "Could not set non-blocking operation on multicast socket"); ++ return (-1); ++ } ++ } ++ ++ recvbuf_size = MCAST_SOCKET_BUFFER_SIZE; ++ sendbuf_size = MCAST_SOCKET_BUFFER_SIZE; ++ ++ res = setsockopt (sockets->local_mcast_loop[0], SOL_SOCKET, SO_RCVBUF, &recvbuf_size, optlen); ++ if (res == -1) { ++ LOGSYS_PERROR (errno, instance->totemudp_log_level_debug, ++ "Unable to set SO_RCVBUF size on UDP local mcast loop socket"); ++ return (-1); ++ } ++ res = setsockopt (sockets->local_mcast_loop[1], SOL_SOCKET, SO_SNDBUF, &sendbuf_size, optlen); ++ if (res == -1) { ++ LOGSYS_PERROR (errno, instance->totemudp_log_level_debug, ++ "Unable to set SO_SNDBUF size on UDP local mcast loop socket"); ++ return (-1); ++ } ++ ++ res = getsockopt (sockets->local_mcast_loop[0], SOL_SOCKET, SO_RCVBUF, &recvbuf_size, &optlen); ++ if (res == 0) { ++ log_printf (instance->totemudp_log_level_debug, ++ "Local receive multicast loop socket recv buffer size (%d bytes).", recvbuf_size); ++ } ++ ++ res = getsockopt (sockets->local_mcast_loop[1], SOL_SOCKET, SO_SNDBUF, &sendbuf_size, &optlen); ++ if (res == 0) { ++ log_printf (instance->totemudp_log_level_debug, ++ "Local transmit multicast loop socket send buffer size (%d bytes).", sendbuf_size); ++ } ++ ++ return (0); ++} ++ + static int totemudp_build_sockets_ip ( + struct totemudp_instance *instance, + struct totem_ip_address *mcast_address, +@@ -730,7 +796,8 @@ static int totemudp_build_sockets_ip ( + int res; + int flag; + uint8_t sflag; +- int i; ++ ++ + + /* + * Create multicast recv socket +@@ -760,24 +827,6 @@ static int totemudp_build_sockets_ip ( + return (-1); + } + +- /* +- * Create local multicast loop socket +- */ +- if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sockets->local_mcast_loop) == -1) { +- LOGSYS_PERROR (errno, instance->totemudp_log_level_warning, +- "socket() failed"); +- return (-1); +- } +- +- for (i = 0; i < 2; i++) { +- totemip_nosigpipe (sockets->local_mcast_loop[i]); +- res = fcntl (sockets->local_mcast_loop[i], F_SETFL, O_NONBLOCK); +- if (res == -1) { +- LOGSYS_PERROR (errno, instance->totemudp_log_level_warning, +- "Could not set non-blocking operation on multicast socket"); +- return (-1); +- } +- } + + + +@@ -875,18 +924,6 @@ static int totemudp_build_sockets_ip ( + "Unable to set SO_SNDBUF size on UDP mcast socket"); + return (-1); + } +- res = setsockopt (sockets->local_mcast_loop[0], SOL_SOCKET, SO_RCVBUF, &recvbuf_size, optlen); +- if (res == -1) { +- LOGSYS_PERROR (errno, instance->totemudp_log_level_debug, +- "Unable to set SO_RCVBUF size on UDP local mcast loop socket"); +- return (-1); +- } +- res = setsockopt (sockets->local_mcast_loop[1], SOL_SOCKET, SO_SNDBUF, &sendbuf_size, optlen); +- if (res == -1) { +- LOGSYS_PERROR (errno, instance->totemudp_log_level_debug, +- "Unable to set SO_SNDBUF size on UDP local mcast loop socket"); +- return (-1); +- } + + res = getsockopt (sockets->mcast_recv, SOL_SOCKET, SO_RCVBUF, &recvbuf_size, &optlen); + if (res == 0) { +@@ -900,17 +937,6 @@ static int totemudp_build_sockets_ip ( + "Transmit multicast socket send buffer size (%d bytes).", sendbuf_size); + } + +- res = getsockopt (sockets->local_mcast_loop[0], SOL_SOCKET, SO_RCVBUF, &recvbuf_size, &optlen); +- if (res == 0) { +- log_printf (instance->totemudp_log_level_debug, +- "Local receive multicast loop socket recv buffer size (%d bytes).", recvbuf_size); +- } +- +- res = getsockopt (sockets->local_mcast_loop[1], SOL_SOCKET, SO_SNDBUF, &sendbuf_size, &optlen); +- if (res == 0) { +- log_printf (instance->totemudp_log_level_debug, +- "Local transmit multicast loop socket send buffer size (%d bytes).", sendbuf_size); +- } + + + /* +@@ -1178,8 +1204,19 @@ int totemudp_initialize ( + + instance->totemudp_target_set_completed = target_set_completed; + +- totemip_localhost (instance->mcast_address.family, &localhost); +- localhost.nodeid = instance->totem_config->node_id; ++ /* ++ * Create static local mcast sockets ++ */ ++ if (totemudp_build_local_sockets(instance, &instance->totemudp_sockets) == -1) { ++ free(instance); ++ return (-1); ++ } ++ ++ qb_loop_poll_add ( ++ instance->totemudp_poll_handle, ++ QB_LOOP_MED, ++ instance->totemudp_sockets.local_mcast_loop[0], ++ POLLIN, instance, net_deliver_fn); + + /* + * RRP layer isn't ready to receive message because it hasn't +@@ -1242,10 +1279,14 @@ int totemudp_recv_flush (void *udp_context) + for (i = 0; i < 2; i++) { + sock = -1; + if (i == 0) { +- sock = instance->totemudp_sockets.mcast_recv; ++ if (instance->netif_bind_state == BIND_STATE_REGULAR) { ++ sock = instance->totemudp_sockets.mcast_recv; ++ } else { ++ continue ; ++ } + } + if (i == 1) { +- sock = instance->totemudp_sockets.local_mcast_loop[0]; ++ sock = instance->totemudp_sockets.local_mcast_loop[0]; + } + assert(sock != -1); + +-- +2.12.3 + diff --git a/corosync.changes b/corosync.changes index e113e6a..f9a6c67 100644 --- a/corosync.changes +++ b/corosync.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Thu Aug 3 02:50:00 UTC 2017 - bliu@suse.com + +- L3: corosync: assert(sender_node != NULL) fails after tearing down a network interface(bsc#1032634) + Added: 0010-fix-ifdown-udp.patch + +------------------------------------------------------------------- +Thu Aug 3 02:49:21 UTC 2017 - bliu@suse.com + +- some errors in spec file(bsc#1047862) + Modified:corosync.spec + 1) as in openSUSE:factory, there are %define, but bcond_with coudld be toggled by osc command , change %define to %bcond_with and %bcond_without + 2) change service_del_postun to service_del_preun, since service_del_postun is not a right macro + + ------------------------------------------------------------------- Mon Jul 31 02:54:49 UTC 2017 - bliu@suse.com diff --git a/corosync.spec b/corosync.spec index 7650fba..027c96a 100644 --- a/corosync.spec +++ b/corosync.spec @@ -16,23 +16,22 @@ # -#%global dirty dirty - # Conditionals # Invoke "rpmbuild --without " or "rpmbuild --with " # to disable or enable specific features -%define with_testagents 1 -%define with_watchdog 1 -%define with_monitoring 0 -%define with_snmp 0 -%define with_dbus 0 -%define with_rdma 0 -%define with_systemd 1 -%define with_xmlconf 0 -%define with_runautogen 1 -%define with_qdevices 1 -%define with_qnetd 1 -%define with_upstart 0 +%bcond_without testagents +%bcond_with watchdog +%bcond_with monitoring +%bcond_with snmp +%bcond_with rdma +%bcond_with dbus +%bcond_with upstart +%bcond_with xmlconf +%bcond_without runautogen +%bcond_without systemd +%bcond_without qdevices +%bcond_without qnetd + %if 0%{?sles_version} == 12 %ifnarch s390 s390x %define buildib 1 @@ -70,6 +69,7 @@ Patch16: 0006-coroapi-Use-size_t-for-private_data_size.patch Patch17: 0007-Make-corosync-work-when-FIPS-mode-is-enabled.patch Patch18: 0008-main.c-add-option-to-set-priority.patch Patch19: 0009-totem-Propagate-totem-initialization-failure.patch +Patch20: 0010-fix-ifdown-udp.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # openais is indeed gone and should be uninstalled. Yes, we do not @@ -91,37 +91,37 @@ BuildRequires: groff BuildRequires: libqb-devel BuildRequires: mozilla-nss-devel BuildRequires: zlib-devel -%if %{with_runautogen} +%if %{with runautogen} BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool %endif -%if %{with_monitoring} +%if %{with monitoring} BuildRequires: libstatgrab-devel %endif -%if %{with_rdma} +%if %{with rdma} BuildRequires: libibverbs-devel BuildRequires: librdmacm-devel %endif -%if %{with_snmp} +%if %{with snmp} BuildRequires: net-snmp-devel %endif -%if %{with_dbus} +%if %{with dbus} BuildRequires: dbus-1-devel %endif -%if %{with_systemd} +%if %{with systemd} BuildRequires: pkgconfig(systemd) Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %endif -%if %{with_xmlconf} +%if %{with xmlconf} Requires: libxslt %endif -%if %{with_qdevices} || %{with_qnetd} +%if %{with qdevices} || %{with qnetd} Requires: mozilla-nss-tools %endif -%if %{with_qnetd} +%if %{with qnetd} BuildRequires: sed %endif @@ -148,41 +148,51 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %patch17 -p1 %patch18 -p1 %patch19 -p1 +%patch20 -p1 %build -%if %{with_runautogen} +%if %{with runautogen} ./autogen.sh %endif -%if %{with_rdma} +%if %{with rdma} export ibverbs_CFLAGS=-I/usr/include/infiniband \ export ibverbs_LIBS=-libverbs \ export rdmacm_CFLAGS=-I/usr/include/rdma \ export rdmacm_LIBS=-lrdmacm \ %endif %{configure} \ -%if %{with_testagents} +%if %{with testagents} --enable-testagents \ %endif -%if %{with_watchdog} +%if %{with watchdog} --enable-watchdog \ %endif -%if %{with_snmp} +%if %{with monitoring} + --enable-monitoring \ +%endif +%if %{with snmp} --enable-snmp \ %endif -%if %{with_rdma} +%if %{with dbus} + --enable-dbus \ +%endif +%if %{with rdma} --enable-rdma \ %endif -%if %{with_systemd} +%if %{with systemd} --enable-systemd \ %endif -%if %{with_xmlconf} +%if %{with upstart} + --enable-upstart \ +%endif +%if %{with xmlconf} --enable-xmlconf \ %endif -%if %{with_qdevices} +%if %{with qdevices} --enable-qdevices \ %endif -%if %{with_qnetd} +%if %{with qnetd} --enable-qnetd \ %endif --with-initddir=%{_initrddir} \ @@ -197,11 +207,11 @@ rm -rf %{buildroot} make install DESTDIR=%{buildroot} -%if %{with_dbus} +%if %{with dbus} mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf %endif -%if %{with_systemd} +%if %{with systemd} ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rccorosync %endif @@ -229,17 +239,17 @@ install -m 755 init/corosync %{buildroot}%{_sysconfdir}/init.d/corosync install -m 755 init/corosync-qdevice %{buildroot}%{_sysconfdir}/init.d/corosync-qdevice install -m 755 init/corosync-qnetd %{buildroot}%{_sysconfdir}/init.d/corosync-qnetd rm -rf %{buildroot}%{localstatedir}/run/ -%if %{with_qdevices} +%if %{with qdevices} install -m 644 init/corosync-qdevice.sysconfig.example \ %{buildroot}/var/adm/fillup-templates/sysconfig.corosync-qdevice install -m 770 -d %{buildroot}/run/corosync-qdevice %endif -%if %{with_qnetd} +%if %{with qnetd} install -m 644 init/corosync-qnetd.sysconfig.example \ %{buildroot}/var/adm/fillup-templates/sysconfig.corosync-qnetd install -m 770 -d %{buildroot}/run/corosync-qnetd -%if %{with_systemd} +%if %{with systemd} sed -i -e 's/^#User=/User=/' \ %{buildroot}%{_unitdir}/corosync-qnetd.service sed -i -e 's/root/coroqnetd/g' \ @@ -258,39 +268,24 @@ This package contains the Corosync Cluster Engine Executive, several default APIs and libraries, default configuration files, and an init script. %pre -%if %{with_systemd} -#we do not use corosync-notifyd.service -%service_add_pre corosync.service -%endif +%service_add_pre corosync.service corosync-notifyd.service %post %{fillup_and_insserv -n corosync} -%if %{with_systemd} -#we do not use corosync-notifyd.service -%service_add_post corosync.service -%endif +%service_add_post corosync.service corosync-notifyd.service + rm -rf %{_sysconfdir}/corosync/corosync.conf.example %{_sysconfdir}/corosync/corosync.conf.example.unicast ln -s /usr/share/doc/packages/corosync/corosync.conf.example %{_sysconfdir}/corosync/ ln -s /usr/share/doc/packages/corosync/corosync.conf.example.udpu %{_sysconfdir}/corosync/corosync.conf.example.unicast %preun - -%if %{with_systemd} -%service_del_preun corosync.service -%else -if [ $1 -eq 0 ]; then - /sbin/service corosync stop &>/dev/null || : - /sbin/chkconfig --del corosync || : -fi -%endif +%service_del_preun corosync.service corosync-notifyd.service %postun if [ -f /etc/sysconfig/corosync ]; then rm /etc/sysconfig/corosync fi -%if %{with_systemd} && 0%{?systemd_postun:1} -%systemd_postun -%endif +%service_del_postun corosync.service corosync-notifyd.service %files %defattr(-,root,root,-) @@ -303,11 +298,11 @@ fi %{_sbindir}/corosync-quorumtool %{_sbindir}/corosync-notifyd %{_sysconfdir}/init.d/corosync -%if %{with_systemd} +%if %{with systemd} %{_sbindir}/rccorosync %endif %{_bindir}/corosync-blackbox -%if %{with_xmlconf} +%if %{with xmlconf} %{_bindir}/corosync-xmlproc %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example %dir %{_datadir}/corosync @@ -323,13 +318,13 @@ fi %config(noreplace) /usr/lib/tmpfiles.d/corosync-notifyd %config(noreplace) /var/adm/fillup-templates/sysconfig.corosync -%if %{with_dbus} +%if %{with dbus} %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf %endif -%if %{with_snmp} +%if %{with snmp} %{_datadir}/snmp/mibs/COROSYNC-MIB.txt %endif -%if %{with_systemd} +%if %{with systemd} %{_unitdir}/corosync.service %{_unitdir}/corosync-notifyd.service %dir %{_datadir}/corosync @@ -339,7 +334,7 @@ fi %{_initrddir}/corosync %{_initrddir}/corosync-notifyd %endif -%if %{with_upstart} +%if %{with upstart} %{_sysconfdir}/init/corosync.conf %{_sysconfdir}/init/corosync-notifyd.conf %endif @@ -360,12 +355,12 @@ fi %{_datadir}/doc/corosync/* # optional testagent rpm # -%if %{with_testagents} +%if %{with testagents} %package -n corosync-testagents Summary: The Corosync Cluster Engine Test Agents Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{version} %description -n corosync-testagents This package contains corosync test agents. @@ -393,7 +388,7 @@ Summary: The Corosync Cluster Engine Libraries Group: Productivity/Clustering/HA Obsoletes: libopenais3 < 1.2 Conflicts: libopenais3 < 1.2 -#Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{version} %description -n libcorosync4 This package contains corosync libraries. @@ -468,7 +463,7 @@ The Corosync Cluster Engine APIs. # optional qdevices # -%if %{with_qdevices} +%if %{with qdevices} %package -n corosync-qdevice Summary: The Corosync Cluster Engine Qdevice @@ -476,7 +471,7 @@ Group: System Environment/Base Requires: corosync Requires: mozilla-nss-tools -%if %{with_systemd} +%if %{with systemd} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -487,25 +482,19 @@ Requires(post): %insserv_prereq %fillup_prereq This package contains the Corosync Cluster Engine Qdevice, script for creating NSS certificates and an init script. +%pre -n corosync-qdevice +%service_add_pre corosync-qdevice + %post -n corosync-qdevice %{fillup_and_insserv -n corosync-qdevice} -#mkdir /run/corosync-qdevice %if %{sles_version} > 0 ln -s /run/corosync-qdevice /var/run/ %endif -%if %{with_systemd} %service_add_post corosync-qdevice.service -%endif %preun -n corosync-qdevice -%if %{with_systemd} %service_del_preun corosync-qdevice.service -%else -if [ $1 -eq 0 ]; then - /sbin/service corosync-qdevice stop &>/dev/null || : - /sbin/chkconfig --del corosync-qdevice || : -fi -%endif + %if %{sles_version} unlink /var/run/corosync-qdevice %endif @@ -514,9 +503,7 @@ unlink /var/run/corosync-qdevice if [ -f /etc/sysconfig/corosync-qdevice ]; then rm /etc/sysconfig/corosync-qdevice fi -%if %{with_systemd} && 0%{?systemd_postun:1} -%systemd_postun -%endif +%service_del_postun corosync-qdevice.service %files -n corosync-qdevice %defattr(-,root,root,-) @@ -529,7 +516,7 @@ fi %{_sbindir}/corosync-qdevice-tool %{_sysconfdir}/init.d/corosync-qdevice %config(noreplace) /var/adm/fillup-templates/sysconfig.corosync-qdevice -%if %{with_systemd} +%if %{with systemd} %{_unitdir}/corosync-qdevice.service %dir %{_datadir}/corosync %{_datadir}/corosync/corosync-qdevice @@ -543,7 +530,7 @@ fi # optional qnetd # -%if %{with_qnetd} +%if %{with qnetd} %package -n corosync-qnetd Summary: The Corosync Cluster Engine Qdevice Network Daemon @@ -551,7 +538,7 @@ Group: System Environment/Base Requires: mozilla-nss-tools Requires(pre): shadow -%if %{with_systemd} +%if %{with systemd} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -567,25 +554,19 @@ getent group coroqnetd >/dev/null || groupadd -r coroqnetd getent passwd coroqnetd >/dev/null || \ useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd exit 0 +%service_add_pre corosync-qnetd.service %post -n corosync-qnetd %if %{sles_version} > 0 ln -s /run/corosync-qnetd /var/run/ %endif %{fillup_and_insserv -n corosync-qnetd} -%if %{with_systemd} + %service_add_post corosync-qnetd.service -%endif %preun -n corosync-qnetd -%if %{with_systemd} %service_del_preun corosync-qnetd.service -%else -if [ $1 -eq 0 ]; then - /sbin/service corosync-qnetd stop &>/dev/null || : - /sbin/chkconfig --del corosync-qnetd || : -fi -%endif + %if %{sles_version} > 0 unlink /var/run/corosync-qnetd %endif @@ -594,9 +575,7 @@ unlink /var/run/corosync-qnetd if [ -f /etc/sysconfig/corosync-qnetd ];then rm /etc/sysconfig/corosync-qnetd fi -%if %{with_systemd} && 0%{?systemd_postun:1} -%systemd_postun -%endif +%service_del_postun corosync-qnetd.service %files -n corosync-qnetd %defattr(-,root,root,-) @@ -608,7 +587,7 @@ fi %{_bindir}/corosync-qnetd-tool %{_sysconfdir}/init.d/corosync-qnetd %config(noreplace) /var/adm/fillup-templates/sysconfig.corosync-qnetd -%if %{with_systemd} +%if %{with systemd} %{_unitdir}/corosync-qnetd.service %dir %{_datadir}/corosync %{_datadir}/corosync/corosync-qnetd From cbb9681882d981b2253566c1fdbdf88c7166b1e9782b3cf40d476d6e4ee3a689 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 8 Aug 2017 08:38:06 +0000 Subject: [PATCH 3/7] Accepting request 515145 from home:jengelh:branches:network:ha-clustering:Factory - Fix RPM groups. OBS-URL: https://build.opensuse.org/request/show/515145 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=98 --- corosync.changes | 5 +++++ corosync.spec | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/corosync.changes b/corosync.changes index f9a6c67..0599140 100644 --- a/corosync.changes +++ b/corosync.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 8 08:17:27 UTC 2017 - jengelh@inai.de + +- Fix RPM groups. + ------------------------------------------------------------------- Thu Aug 3 02:50:00 UTC 2017 - bliu@suse.com diff --git a/corosync.spec b/corosync.spec index 027c96a..a0afcd3 100644 --- a/corosync.spec +++ b/corosync.spec @@ -359,7 +359,7 @@ fi %package -n corosync-testagents Summary: The Corosync Cluster Engine Test Agents -Group: Development/Libraries +Group: Development/Tools/Other Requires: %{name} = %{version} %description -n corosync-testagents @@ -385,7 +385,7 @@ This package contains corosync test agents. Summary: The Corosync Cluster Engine Libraries # openais is indeed gone and should be uninstalled. Yes, we do not # provide libopenais on purpose, the package has been deleted. -Group: Productivity/Clustering/HA +Group: System/Libraries Obsoletes: libopenais3 < 1.2 Conflicts: libopenais3 < 1.2 Requires: %{name} = %{version} @@ -411,7 +411,7 @@ This package contains corosync libraries. %package -n libcorosync-devel Summary: The Corosync Cluster Engine Development Kit -Group: Productivity/Clustering/HA +Group: Development/Libraries/C and C++ Requires: libcorosync4 = %{version}-%{release} Requires: libqb-devel Requires: pkgconfig @@ -467,7 +467,7 @@ The Corosync Cluster Engine APIs. %package -n corosync-qdevice Summary: The Corosync Cluster Engine Qdevice -Group: System Environment/Base +Group: System/Base Requires: corosync Requires: mozilla-nss-tools @@ -534,7 +534,7 @@ fi %package -n corosync-qnetd Summary: The Corosync Cluster Engine Qdevice Network Daemon -Group: System Environment/Base +Group: System/Base Requires: mozilla-nss-tools Requires(pre): shadow From 20bf4468027ddcca873ad84233dd5a23e9a0b541508260ef78744fb4b8aff74a Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 15 Aug 2017 07:08:53 +0000 Subject: [PATCH 4/7] Accepting request 516959 from home:BinLiu:branches:network:ha-clustering:Factory OBS-URL: https://build.opensuse.org/request/show/516959 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=99 --- corosync.spec | 49 ++++++++++++++++++------------------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/corosync.spec b/corosync.spec index a0afcd3..25915e6 100644 --- a/corosync.spec +++ b/corosync.spec @@ -81,7 +81,6 @@ Conflicts: openais < 1.2 Requires: libcorosync4 = %{version}-%{release} Requires(pre): /usr/sbin/useradd Requires(post): /sbin/chkconfig -Requires(post): %insserv_prereq %fillup_prereq Requires(preun): /sbin/chkconfig Conflicts: openais <= 0.89, openais-devel <= 0.89 @@ -213,6 +212,9 @@ install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buil %endif %if %{with systemd} ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rccorosync +ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rccorosync-qnetd +ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rccorosync-qdevice +ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rccorosync-notifyd %endif ## tree fixup @@ -221,6 +223,8 @@ rm -f %{buildroot}%{_libdir}/*.a rm -f %{buildroot}%{_libdir}/*.la # drop docs and html docs for now rm -rf %{buildroot}%{_docdir}/* +#remove init scripts for corosync, corosync-qdevice, corosync-qnetd +rm -rf init/corosync init/corosync-qnetd init/corosync-qdevice mkdir -p %{buildroot}/usr/lib/tmpfiles.d/ mkdir -p %{buildroot}/usr/share/doc/packages/corosync/ mkdir -p %{buildroot}/var/adm/fillup-templates/ @@ -230,14 +234,8 @@ install -m 0644 conf/corosync.conf.example* %{buildroot}/usr/share/doc/packages/ rm -rf %{buildroot}/etc/corosync/corosync.conf.example* rm -rf %{buildroot}/etc/logrotate.d/ mkdir -p %{buildroot}%{_sysconfdir}/sysconfig -install -m 644 tools/corosync-notifyd.sysconfig.example \ - %{buildroot}/usr/lib/tmpfiles.d/corosync-notifyd install -m 644 init/corosync.sysconfig.example \ %{buildroot}/var/adm/fillup-templates/sysconfig.corosync -#add init scripts for corosync, corosync-qdevice, corosync-qnetd -install -m 755 init/corosync %{buildroot}%{_sysconfdir}/init.d/corosync -install -m 755 init/corosync-qdevice %{buildroot}%{_sysconfdir}/init.d/corosync-qdevice -install -m 755 init/corosync-qnetd %{buildroot}%{_sysconfdir}/init.d/corosync-qnetd rm -rf %{buildroot}%{localstatedir}/run/ %if %{with qdevices} install -m 644 init/corosync-qdevice.sysconfig.example \ @@ -271,6 +269,7 @@ APIs and libraries, default configuration files, and an init script. %service_add_pre corosync.service corosync-notifyd.service %post +#%tmpfiles_create /usr/lib/tmpfiles.d/corosync-notifyd %{fillup_and_insserv -n corosync} %service_add_post corosync.service corosync-notifyd.service @@ -297,9 +296,9 @@ fi %{_sbindir}/corosync-cpgtool %{_sbindir}/corosync-quorumtool %{_sbindir}/corosync-notifyd -%{_sysconfdir}/init.d/corosync %if %{with systemd} %{_sbindir}/rccorosync +%{_sbindir}/rccorosync-notifyd %endif %{_bindir}/corosync-blackbox %if %{with xmlconf} @@ -330,9 +329,6 @@ fi %dir %{_datadir}/corosync %{_datadir}/corosync/corosync %{_datadir}/corosync/corosync-notifyd -%else -%{_initrddir}/corosync -%{_initrddir}/corosync-notifyd %endif %if %{with upstart} %{_sysconfdir}/init/corosync.conf @@ -388,7 +384,6 @@ Summary: The Corosync Cluster Engine Libraries Group: System/Libraries Obsoletes: libopenais3 < 1.2 Conflicts: libopenais3 < 1.2 -Requires: %{name} = %{version} %description -n libcorosync4 This package contains corosync libraries. @@ -461,8 +456,6 @@ The Corosync Cluster Engine APIs. %post -n libcorosync-devel -p /sbin/ldconfig %postun -n libcorosync-devel -p /sbin/ldconfig -# optional qdevices -# %if %{with qdevices} %package -n corosync-qdevice @@ -475,7 +468,6 @@ Requires: mozilla-nss-tools Requires(post): systemd Requires(preun): systemd Requires(postun): systemd -Requires(post): %insserv_prereq %fillup_prereq %endif %description -n corosync-qdevice @@ -483,7 +475,7 @@ This package contains the Corosync Cluster Engine Qdevice, script for creating NSS certificates and an init script. %pre -n corosync-qdevice -%service_add_pre corosync-qdevice +%service_add_pre corosync-qdevice.service %post -n corosync-qdevice %{fillup_and_insserv -n corosync-qdevice} @@ -514,22 +506,18 @@ fi %{_sbindir}/corosync-qdevice %{_sbindir}/corosync-qdevice-net-certutil %{_sbindir}/corosync-qdevice-tool -%{_sysconfdir}/init.d/corosync-qdevice %config(noreplace) /var/adm/fillup-templates/sysconfig.corosync-qdevice %if %{with systemd} %{_unitdir}/corosync-qdevice.service +%{_sbindir}/rccorosync-qdevice %dir %{_datadir}/corosync %{_datadir}/corosync/corosync-qdevice -%else -%{_initrddir}/corosync-qdevice %endif %{_mandir}/man8/corosync-qdevice-tool.8* %{_mandir}/man8/corosync-qdevice-net-certutil.8* %{_mandir}/man8/corosync-qdevice.8* %endif -# optional qnetd -# %if %{with qnetd} %package -n corosync-qnetd @@ -542,7 +530,6 @@ Requires(pre): shadow Requires(post): systemd Requires(preun): systemd Requires(postun): systemd -Requires(post): %insserv_prereq %fillup_prereq %endif %description -n corosync-qnetd @@ -550,13 +537,15 @@ This package contains the Corosync Cluster Engine Qdevice Network Daemon, script NSS certificates and an init script. %pre -n corosync-qnetd -getent group coroqnetd >/dev/null || groupadd -r coroqnetd -getent passwd coroqnetd >/dev/null || \ - useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd -exit 0 +getent group coroqnetd >/dev/null || groupadd -r coroqnetd -g 701 +getent passwd coroqnetd >/dev/null || useradd -r -g coroqnetd -u 701 -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd + %service_add_pre corosync-qnetd.service +exit 0 + %post -n corosync-qnetd +#%tmpfiles_create /usr/lib/tmpfiles.d/corosync-qnetd.conf %if %{sles_version} > 0 ln -s /run/corosync-qnetd /var/run/ %endif @@ -579,21 +568,19 @@ fi %files -n corosync-qnetd %defattr(-,root,root,-) -%dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd +%dir %config(noreplace) %attr(750, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd #change corosync-qnetd to /run as /var/run is just symlink nowadays -%ghost %attr(770, coroqnetd, coroqnetd) /run/corosync-qnetd +%ghost %attr (750, coroqnetd, coroqnetd) /run/corosync-qnetd %{_bindir}/corosync-qnetd %{_bindir}/corosync-qnetd-certutil %{_bindir}/corosync-qnetd-tool -%{_sysconfdir}/init.d/corosync-qnetd %config(noreplace) /var/adm/fillup-templates/sysconfig.corosync-qnetd %if %{with systemd} %{_unitdir}/corosync-qnetd.service +%{_sbindir}/rccorosync-qnetd %dir %{_datadir}/corosync %{_datadir}/corosync/corosync-qnetd %{_tmpfilesdir}/corosync-qnetd.conf -%else -%{_initrddir}/corosync-qnetd %endif %{_mandir}/man8/corosync-qnetd-tool.8* %{_mandir}/man8/corosync-qnetd-certutil.8* From bb971355cb19dc71db2a9bc7c2614cb6bfffb1a20cb16474f643fe38e65bc27c Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Wed, 16 Aug 2017 06:29:09 +0000 Subject: [PATCH 5/7] Accepting request 517123 from home:BinLiu:branches:network:ha-clustering:Factory - Fix rpmlint warnings Added: 0011-fix-tmpfiles-create.patch OBS-URL: https://build.opensuse.org/request/show/517123 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=100 --- 0011-fix-tmpfiles-create.patch | 9 +++++++++ corosync.changes | 3 +++ corosync.spec | 11 +++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 0011-fix-tmpfiles-create.patch diff --git a/0011-fix-tmpfiles-create.patch b/0011-fix-tmpfiles-create.patch new file mode 100644 index 0000000..db8b2d9 --- /dev/null +++ b/0011-fix-tmpfiles-create.patch @@ -0,0 +1,9 @@ +--- corosync-2.4.2.orig/tools/corosync-notifyd.sysconfig.example 2016-11-08 00:39:12.000000000 +0800 ++++ corosync-2.4.2/tools/corosync-notifyd.sysconfig.example 2017-08-16 11:41:00.485913615 +0800 +@@ -6,5 +6,4 @@ + # + + # Send DBUS signals on all events (for SNMP traps, use -s) +-OPTIONS="-d" +- ++# OPTIONS="-d" diff --git a/corosync.changes b/corosync.changes index 0599140..8e75b22 100644 --- a/corosync.changes +++ b/corosync.changes @@ -9,6 +9,9 @@ Thu Aug 3 02:50:00 UTC 2017 - bliu@suse.com - L3: corosync: assert(sender_node != NULL) fails after tearing down a network interface(bsc#1032634) Added: 0010-fix-ifdown-udp.patch +- Fix rpmlint warnings + Added: 0011-fix-tmpfiles-create.patch + ------------------------------------------------------------------- Thu Aug 3 02:49:21 UTC 2017 - bliu@suse.com diff --git a/corosync.spec b/corosync.spec index 25915e6..c7cff13 100644 --- a/corosync.spec +++ b/corosync.spec @@ -32,6 +32,11 @@ %bcond_without qdevices %bcond_without qnetd +%if %{defined tmpfiles_create} +%else +%define tmpfiles_create systemd-tmpfiles --create +%endif + %if 0%{?sles_version} == 12 %ifnarch s390 s390x %define buildib 1 @@ -70,6 +75,7 @@ Patch17: 0007-Make-corosync-work-when-FIPS-mode-is-enabled.patch Patch18: 0008-main.c-add-option-to-set-priority.patch Patch19: 0009-totem-Propagate-totem-initialization-failure.patch Patch20: 0010-fix-ifdown-udp.patch +Patch21: 0011-fix-tmpfiles-create.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # openais is indeed gone and should be uninstalled. Yes, we do not @@ -148,6 +154,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 %build %if %{with runautogen} @@ -269,7 +276,7 @@ APIs and libraries, default configuration files, and an init script. %service_add_pre corosync.service corosync-notifyd.service %post -#%tmpfiles_create /usr/lib/tmpfiles.d/corosync-notifyd +%tmpfiles_create /usr/lib/tmpfiles.d/corosync-notifyd %{fillup_and_insserv -n corosync} %service_add_post corosync.service corosync-notifyd.service @@ -545,7 +552,7 @@ getent passwd coroqnetd >/dev/null || useradd -r -g coroqnetd -u 701 -s /sbin/no exit 0 %post -n corosync-qnetd -#%tmpfiles_create /usr/lib/tmpfiles.d/corosync-qnetd.conf +%tmpfiles_create /usr/lib/tmpfiles.d/corosync-qnetd.conf %if %{sles_version} > 0 ln -s /run/corosync-qnetd /var/run/ %endif From 8b1c4d6765c0886f7d370ec03d12bbeff3c3c7d39f93644f5a2a0121fc311dfa Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Wed, 16 Aug 2017 09:24:22 +0000 Subject: [PATCH 6/7] OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=101 --- corosync.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/corosync.spec b/corosync.spec index c7cff13..cab1d30 100644 --- a/corosync.spec +++ b/corosync.spec @@ -32,8 +32,7 @@ %bcond_without qdevices %bcond_without qnetd -%if %{defined tmpfiles_create} -%else +%if !%{defined tmpfiles_create} %define tmpfiles_create systemd-tmpfiles --create %endif From adcd55847e753b8202f2892abfeafbf648e0e97038808025394ad0149233c9f1 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Wed, 16 Aug 2017 09:34:33 +0000 Subject: [PATCH 7/7] OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=102 --- corosync.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corosync.spec b/corosync.spec index cab1d30..33dffc0 100644 --- a/corosync.spec +++ b/corosync.spec @@ -33,7 +33,7 @@ %bcond_without qnetd %if !%{defined tmpfiles_create} -%define tmpfiles_create systemd-tmpfiles --create +%define tmpfiles_create systemd-tmpfiles --create ||: %endif %if 0%{?sles_version} == 12