Sync from SUSE:SLFO:Main corosync revision 4f06c56c113a98dacd98cb31b139241b
This commit is contained in:
commit
2a513e68b5
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
37
Fix-compile-warnings-with-GCC-7.2.1.patch
Normal file
37
Fix-compile-warnings-with-GCC-7.2.1.patch
Normal file
@ -0,0 +1,37 @@
|
||||
//cpg_test_agent: Fix snprintf compiler warnings
|
||||
---
|
||||
cts/agents/cpg_test_agent.c | 8 ++++----
|
||||
exec/coroparse.c | 18 +++---------------
|
||||
lib/sam.c | 36 ++++++++++++++++++++++++++++--------
|
||||
tools/corosync-quorumtool.c | 2 +-
|
||||
4 files changed, 36 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/cts/agents/cpg_test_agent.c b/cts/agents/cpg_test_agent.c
|
||||
index 0837c69c..2224141c 100644
|
||||
--- a/cts/agents/cpg_test_agent.c
|
||||
+++ b/cts/agents/cpg_test_agent.c
|
||||
@@ -211,8 +211,8 @@ static void config_change_callback (
|
||||
if (record_config_events_g > 0) {
|
||||
log_pt = malloc (sizeof(log_entry_t));
|
||||
list_init (&log_pt->list);
|
||||
- snprintf (log_pt->log, LOG_STR_SIZE, "%s,%u,%u,left",
|
||||
- groupName->value, left_list[i].nodeid,left_list[i].pid);
|
||||
+ assert(snprintf (log_pt->log, LOG_STR_SIZE, "%s,%u,%u,left",
|
||||
+ groupName->value, left_list[i].nodeid,left_list[i].pid) < LOG_STR_SIZE);
|
||||
list_add_tail(&log_pt->list, &config_chg_log_head);
|
||||
qb_log (LOG_INFO, "cpg event %s", log_pt->log);
|
||||
}
|
||||
@@ -221,8 +221,8 @@ static void config_change_callback (
|
||||
if (record_config_events_g > 0) {
|
||||
log_pt = malloc (sizeof(log_entry_t));
|
||||
list_init (&log_pt->list);
|
||||
- snprintf (log_pt->log, LOG_STR_SIZE, "%s,%u,%u,join",
|
||||
- groupName->value, joined_list[i].nodeid,joined_list[i].pid);
|
||||
+ assert(snprintf (log_pt->log, LOG_STR_SIZE, "%s,%u,%u,join",
|
||||
+ groupName->value, joined_list[i].nodeid,joined_list[i].pid) < LOG_STR_SIZE);
|
||||
list_add_tail (&log_pt->list, &config_chg_log_head);
|
||||
qb_log (LOG_INFO, "cpg event %s", log_pt->log);
|
||||
}
|
||||
--
|
||||
2.13.6
|
||||
|
21
_service
Normal file
21
_service
Normal file
@ -0,0 +1,21 @@
|
||||
<services>
|
||||
<service name="tar_scm" mode="disabled">
|
||||
<param name="url">git://github.com/corosync/corosync.git</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="exclude">.git</param>
|
||||
<param name="filename">corosync</param>
|
||||
<param name="versionformat">2.4.5+git@TAG_OFFSET@.%h</param>
|
||||
<param name="revision">needle</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
<service name="recompress" mode="disabled">
|
||||
<param name="file">corosync*.tar</param>
|
||||
<param name="compression">bz2</param>
|
||||
</service>
|
||||
<!--
|
||||
<service name="set_version" mode="disabled">
|
||||
<param name="basename">corosync</param>
|
||||
</service>
|
||||
-->
|
||||
</services>
|
||||
|
4
_servicedata
Normal file
4
_servicedata
Normal file
@ -0,0 +1,4 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">git://github.com/corosync/corosync.git</param>
|
||||
<param name="changesrevision">64010f573801b73222e80821a19140c59b003f5c</param></service></servicedata>
|
10
baselibs.conf
Normal file
10
baselibs.conf
Normal file
@ -0,0 +1,10 @@
|
||||
libcfg6
|
||||
libcmap4
|
||||
libcorosync_common4
|
||||
obsoletes "libcorosync4-<targettype> < <version>"
|
||||
provides "libcorosync4-<targettype> = <version>"
|
||||
libcpg4
|
||||
libquorum5
|
||||
libsam4
|
||||
libtotem_pg5
|
||||
libvotequorum8
|
23
bug-1001164_corosync.conf-example.patch
Normal file
23
bug-1001164_corosync.conf-example.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff -Naur corosync-2.4.5/conf/corosync.conf.example corosync-2.4.5-new/conf/corosync.conf.example
|
||||
--- corosync-2.4.5/conf/corosync.conf.example 2019-08-16 17:30:52.306726801 +0800
|
||||
+++ corosync-2.4.5-new/conf/corosync.conf.example 2019-08-16 17:33:25.687567471 +0800
|
||||
@@ -9,6 +9,19 @@
|
||||
crypto_cipher: none
|
||||
crypto_hash: none
|
||||
|
||||
+ # How long before declaring a token lost (ms)
|
||||
+ token: 5000
|
||||
+
|
||||
+ # How many token retransmits before forming a new configuration
|
||||
+ token_retransmits_before_loss_const: 10
|
||||
+
|
||||
+ # How long to wait for join messages in the membership protocol (ms)
|
||||
+ join: 60
|
||||
+
|
||||
+ # Number of messages that may be sent by one processor on
|
||||
+ # receipt of the token
|
||||
+ max_messages: 20
|
||||
+
|
||||
# Limit generated nodeids to 31-bits (positive signed integers)
|
||||
# you would set it to 'yes', the new option 'new' means wiping
|
||||
# off the highest bit in network order to avoid possible nodeid
|
363
bug-1032634_fix-ifdown-udp.patch
Normal file
363
bug-1032634_fix-ifdown-udp.patch
Normal file
@ -0,0 +1,363 @@
|
||||
From ec2dfbec877fee166b31493e2dba41a850380608 Mon Sep 17 00:00:00 2001
|
||||
From: Bin Liu <bliu@suse.com>
|
||||
Date: Tue, 17 Apr 2018 18:04:52 +0800
|
||||
Subject: [PATCH] totemudp: Add local loop support for unicast msgs
|
||||
|
||||
---
|
||||
exec/totemudp.c | 218 ++++++++++++++++++++++++++++++++------------------------
|
||||
1 file changed, 126 insertions(+), 92 deletions(-)
|
||||
|
||||
diff --git a/exec/totemudp.c b/exec/totemudp.c
|
||||
index 4b644ae..ea18897 100644
|
||||
--- a/exec/totemudp.c
|
||||
+++ b/exec/totemudp.c
|
||||
@@ -205,8 +205,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));
|
||||
@@ -267,6 +265,7 @@ static inline void ucast_sendmsg (
|
||||
struct sockaddr_storage sockaddr;
|
||||
struct iovec iovec;
|
||||
int addrlen;
|
||||
+ int send_sock;
|
||||
|
||||
if (msg_len + crypto_get_current_sec_header_size(instance->crypto_inst) > sizeof(buf_out)) {
|
||||
log_printf(LOGSYS_LEVEL_CRIT, "UDP message for ucast is too big. Ignoring message");
|
||||
@@ -317,11 +316,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,
|
||||
@@ -390,18 +397,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;
|
||||
+ }
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -580,7 +589,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
|
||||
@@ -617,28 +625,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
|
||||
@@ -654,34 +665,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);
|
||||
|
||||
@@ -732,6 +738,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,
|
||||
@@ -755,7 +821,6 @@ static int totemudp_build_sockets_ip (
|
||||
int res;
|
||||
int flag;
|
||||
uint8_t sflag;
|
||||
- int i;
|
||||
|
||||
/*
|
||||
* Create multicast recv socket
|
||||
@@ -786,27 +851,6 @@ static int totemudp_build_sockets_ip (
|
||||
}
|
||||
|
||||
/*
|
||||
- * 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);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
-
|
||||
-
|
||||
- /*
|
||||
* Setup mcast send socket
|
||||
*/
|
||||
sockets->mcast_send = socket (bindnet_address->family, SOCK_DGRAM, 0);
|
||||
@@ -930,18 +974,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) {
|
||||
@@ -955,19 +987,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);
|
||||
- }
|
||||
-
|
||||
-
|
||||
/*
|
||||
* Join group membership on socket
|
||||
*/
|
||||
@@ -1256,8 +1275,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
|
||||
@@ -1320,10 +1350,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.13.6
|
||||
|
21
bug-1083561_upgrade-from-1-x-y.patch
Normal file
21
bug-1083561_upgrade-from-1-x-y.patch
Normal file
@ -0,0 +1,21 @@
|
||||
--- corosync-2.4.5/init/upgrade.sh 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ corosync-2.4.5-new/init/upgrade.sh 2019-08-02 17:15:38.224559371 +0800
|
||||
@@ -0,0 +1,18 @@
|
||||
+#! /bin/bash
|
||||
+CONFIG_FILE=/etc/corosync/corosync.conf
|
||||
+CONFIG_FILE_OLD=/etc/corosync/corosync.conf.old
|
||||
+
|
||||
+if [ -f $CONFIG_FILE ]; then
|
||||
+ cp $CONFIG_FILE $CONFIG_FILE_OLD
|
||||
+ #lots of operations
|
||||
+ sed -i "/amf\ *{/,/\ *}/d" $CONFIG_FILE && \
|
||||
+ sed -i "/aisexec\ *{/,/\ *}/d" $CONFIG_FILE && \
|
||||
+ sed -i "/service\ *{/,/\ *}/d" $CONFIG_FILE && \
|
||||
+ #sed -i "/token:/,/max_messages:/d" $CONFIG_FILE && \
|
||||
+ sed -i "s/AMF/QUORUM/g" $CONFIG_FILE
|
||||
+ if [ $? -ne 0 ]; then
|
||||
+ cp $CONFIG_FILE_OLD $CONFIG_FILE
|
||||
+ else
|
||||
+ rm $CONFIG_FILE_OLD
|
||||
+ fi
|
||||
+fi
|
67
bug-882449_corosync-conf-example.patch
Normal file
67
bug-882449_corosync-conf-example.patch
Normal file
@ -0,0 +1,67 @@
|
||||
Index: corosync-2.3.3/conf/corosync.conf.example
|
||||
===================================================================
|
||||
--- corosync-2.3.3.orig/conf/corosync.conf.example
|
||||
+++ corosync-2.3.3/conf/corosync.conf.example
|
||||
@@ -9,6 +9,12 @@ totem {
|
||||
crypto_cipher: none
|
||||
crypto_hash: none
|
||||
|
||||
+ # Limit generated nodeids to 31-bits (positive signed integers)
|
||||
+ # you would set it to 'yes', the new option 'new' means wiping
|
||||
+ # off the highest bit in network order to avoid possible nodeid
|
||||
+ # conflicting.
|
||||
+ clear_node_high_bit: yes
|
||||
+
|
||||
# interface: define at least one interface to communicate
|
||||
# over. If you define more than one interface stanza, you must
|
||||
# also set rrp_mode.
|
||||
@@ -58,8 +64,8 @@ logging {
|
||||
to_stderr: no
|
||||
# Log to a log file. When set to "no", the "logfile" option
|
||||
# must not be set.
|
||||
- to_logfile: yes
|
||||
- logfile: /var/log/cluster/corosync.log
|
||||
+ #to_logfile: no
|
||||
+ #logfile: /var/log/cluster/corosync.log
|
||||
# Log to the system log daemon. When in doubt, set to yes.
|
||||
to_syslog: yes
|
||||
# Log debug messages (very verbose). When in doubt, leave off.
|
||||
@@ -77,5 +83,5 @@ logging {
|
||||
quorum {
|
||||
# Enable and configure quorum subsystem (default: off)
|
||||
# see also corosync.conf.5 and votequorum.5
|
||||
- #provider: corosync_votequorum
|
||||
+ provider: corosync_votequorum
|
||||
}
|
||||
Index: corosync-2.3.3/conf/corosync.conf.example.udpu
|
||||
===================================================================
|
||||
--- corosync-2.3.3.orig/conf/corosync.conf.example.udpu
|
||||
+++ corosync-2.3.3/conf/corosync.conf.example.udpu
|
||||
@@ -5,6 +5,8 @@ totem {
|
||||
crypto_cipher: none
|
||||
crypto_hash: none
|
||||
|
||||
+ clear_node_high_bit: yes
|
||||
+
|
||||
interface {
|
||||
ringnumber: 0
|
||||
bindnetaddr: 10.16.35.0
|
||||
@@ -16,9 +18,9 @@ totem {
|
||||
|
||||
logging {
|
||||
fileline: off
|
||||
- to_logfile: yes
|
||||
+ #to_logfile: no
|
||||
to_syslog: yes
|
||||
- logfile: /var/log/cluster/corosync.log
|
||||
+ #logfile: /var/log/cluster/corosync.log
|
||||
debug: off
|
||||
timestamp: on
|
||||
logger_subsys {
|
||||
@@ -54,5 +56,5 @@ nodelist {
|
||||
quorum {
|
||||
# Enable and configure quorum subsystem (default: off)
|
||||
# see also corosync.conf.5 and votequorum.5
|
||||
- #provider: corosync_votequorum
|
||||
+ provider: corosync_votequorum
|
||||
}
|
33
corosync-2.3.4-fix-bashisms.patch
Normal file
33
corosync-2.3.4-fix-bashisms.patch
Normal file
@ -0,0 +1,33 @@
|
||||
--- corosync-2.3.5.orig/cts/agents/mem_leak_test.sh 2015-07-21 13:47:30.058803324 +0800
|
||||
+++ corosync-2.3.5/cts/agents/mem_leak_test.sh 2015-07-27 10:03:53.903380662 +0800
|
||||
@@ -41,14 +41,14 @@
|
||||
find $f | sed "s|\.|_|g" | sed "s|/|.|g" | while read l
|
||||
do
|
||||
echo $l.count u64 $COUNT >> $temp_file
|
||||
- let COUNT="$COUNT+1"
|
||||
+ COUNT="$COUNT+1"
|
||||
done
|
||||
|
||||
corosync-cmapctl -p $temp_file
|
||||
corosync-cmapctl -D usr
|
||||
done
|
||||
AFTER=$(get_mem $TYPE)
|
||||
- let DIFF="$AFTER - $BEFORE"
|
||||
+ DIFF="$AFTER - $BEFORE"
|
||||
rm -f $temp_file
|
||||
#echo $f diff $TYPE $DIFF
|
||||
echo $DIFF
|
||||
@@ -76,11 +76,11 @@
|
||||
find /usr/bin | sed "s|\.|_|g" | sed "s|/|.|g" | while read l
|
||||
do
|
||||
corosync-cmapctl -s $l u32 $COUNT
|
||||
- let COUNT="$COUNT+1"
|
||||
+ COUNT="$COUNT+1"
|
||||
done
|
||||
corosync-cmapctl -D usr
|
||||
AFTER=$(get_mem $TYPE)
|
||||
- let DIFF="$AFTER - $BEFORE"
|
||||
+ DIFF="$AFTER - $BEFORE"
|
||||
echo $DIFF
|
||||
|
||||
exit 0
|
BIN
corosync-2.4.6.tar.gz
(Stored with Git LFS)
Normal file
BIN
corosync-2.4.6.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
19
corosync-init-lockfile-path-error.patch
Normal file
19
corosync-init-lockfile-path-error.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff -Naur corosync-2.4.5/init/corosync.in corosync-2.4.5-new/init/corosync.in
|
||||
--- corosync-2.4.5/init/corosync.in 2019-08-16 18:38:12.029553632 +0800
|
||||
+++ corosync-2.4.5-new/init/corosync.in 2019-08-16 18:39:59.138161517 +0800
|
||||
@@ -30,6 +30,7 @@
|
||||
success()
|
||||
{
|
||||
echo -ne "[ OK ]\r"
|
||||
+ rtrn=0
|
||||
}
|
||||
|
||||
failure()
|
||||
@@ -150,6 +151,7 @@
|
||||
# they also assume that init scripts will create
|
||||
# required subdirectories for proper operations
|
||||
mkdir -p @LOCALSTATEDIR@/run
|
||||
+ mkdir -p @LOCALSTATEDIR@/lock/subsys
|
||||
|
||||
if status -p "$prog_pid_file" "$prog" > /dev/null 2>&1; then
|
||||
success
|
59
corosync-start-stop-level.patch
Normal file
59
corosync-start-stop-level.patch
Normal file
@ -0,0 +1,59 @@
|
||||
From b827e7f33fee652a79713d302aa9be56b456fa7d Mon Sep 17 00:00:00 2001
|
||||
From: Bin Liu <bliu@suse.com>
|
||||
Date: Wed, 19 Oct 2016 15:59:17 +0800
|
||||
Subject: [PATCH] modify default run level for corosync daemons
|
||||
|
||||
---
|
||||
init/corosync-qdevice.in | 4 ++--
|
||||
init/corosync-qnetd.in | 4 ++--
|
||||
init/corosync.in | 4 ++--
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/init/corosync-qdevice.in b/init/corosync-qdevice.in
|
||||
index 913e033..4949c4e 100755
|
||||
--- a/init/corosync-qdevice.in
|
||||
+++ b/init/corosync-qdevice.in
|
||||
@@ -13,8 +13,8 @@
|
||||
# Provides: corosync-qdevice
|
||||
# Required-Start: $corosync
|
||||
# Required-Stop: $corosync
|
||||
-# Default-Start:
|
||||
-# Default-Stop:
|
||||
+# Default-Start: 3
|
||||
+# Default-Stop: 1
|
||||
# Short-Description: Starts and stops Corosync Qdevice daemon.
|
||||
# Description: Starts and stops Corosync Qdevice daemon.
|
||||
### END INIT INFO
|
||||
diff --git a/init/corosync-qnetd.in b/init/corosync-qnetd.in
|
||||
index 15d30ea..ed73ee0 100755
|
||||
--- a/init/corosync-qnetd.in
|
||||
+++ b/init/corosync-qnetd.in
|
||||
@@ -13,8 +13,8 @@
|
||||
# Provides: corosync-qnetd
|
||||
# Required-Start: $network $syslog
|
||||
# Required-Stop: $network $syslog
|
||||
-# Default-Start:
|
||||
-# Default-Stop:
|
||||
+# Default-Start: 3
|
||||
+# Default-Stop: 1
|
||||
# Short-Description: Starts and stops Corosync Qdevice Network daemon.
|
||||
# Description: Starts and stops Corosync Qdevice Network daemon.
|
||||
### END INIT INFO
|
||||
diff --git a/init/corosync.in b/init/corosync.in
|
||||
index c93f971..366b5d6 100755
|
||||
--- a/init/corosync.in
|
||||
+++ b/init/corosync.in
|
||||
@@ -14,8 +14,8 @@
|
||||
# Provides: corosync
|
||||
# Required-Start: $network $syslog
|
||||
# Required-Stop: $network $syslog
|
||||
-# Default-Start:
|
||||
-# Default-Stop:
|
||||
+# Default-Start: 3
|
||||
+# Default-Stop: 1
|
||||
# Short-Description: Starts and stops Corosync Cluster Engine.
|
||||
# Description: Starts and stops Corosync Cluster Engine.
|
||||
### END INIT INFO
|
||||
--
|
||||
2.6.6
|
||||
|
1302
corosync.changes
Normal file
1302
corosync.changes
Normal file
File diff suppressed because it is too large
Load Diff
705
corosync.spec
Normal file
705
corosync.spec
Normal file
@ -0,0 +1,705 @@
|
||||
#
|
||||
# spec file for package corosync
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
||||
%if ! %{defined _fillupdir}
|
||||
%define _fillupdir /var/adm/fillup-templates
|
||||
%endif
|
||||
|
||||
# Conditionals
|
||||
# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
|
||||
# to disable or enable specific features
|
||||
%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
|
||||
%endif
|
||||
%endif
|
||||
|
||||
Name: corosync
|
||||
Summary: The Corosync Cluster Engine and Application Programming Interfaces
|
||||
License: BSD-3-Clause
|
||||
Group: Productivity/Clustering/HA
|
||||
Version: 2.4.6
|
||||
Release: 0
|
||||
URL: http://corosync.github.io/corosync/
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Source2: baselibs.conf
|
||||
Patch1: upstream-afd97d7884940_coroapi-Use-size_t-for-private_data_size.patch
|
||||
Patch2: Fix-compile-warnings-with-GCC-7.2.1.patch
|
||||
Patch3: bug-1083561_upgrade-from-1-x-y.patch
|
||||
Patch4: bug-882449_corosync-conf-example.patch
|
||||
Patch5: bug-1032634_fix-ifdown-udp.patch
|
||||
Patch6: bug-1001164_corosync.conf-example.patch
|
||||
Patch7: corosync-2.3.4-fix-bashisms.patch
|
||||
Patch8: corosync-init-lockfile-path-error.patch
|
||||
Patch9: corosync-start-stop-level.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
# openais is indeed gone and should be uninstalled. Yes, we do not
|
||||
# provide openais on purpose, the package has been deleted.
|
||||
Obsoletes: openais < 1.2
|
||||
Conflicts: openais < 1.2
|
||||
|
||||
# Runtime bits
|
||||
Requires: libcfg6 = %{version}-%{release}
|
||||
Requires: libcmap4 = %{version}-%{release}
|
||||
Requires: libcorosync_common4 = %{version}-%{release}
|
||||
Requires: libcpg4 = %{version}-%{release}
|
||||
Requires: libquorum5 = %{version}-%{release}
|
||||
Requires: libsam4 = %{version}-%{release}
|
||||
Requires: libtotem_pg5 = %{version}-%{release}
|
||||
Requires: libvotequorum8 = %{version}-%{release}
|
||||
Conflicts: openais <= 0.89
|
||||
Conflicts: openais-devel <= 0.89
|
||||
|
||||
# Build bits
|
||||
|
||||
BuildRequires: groff-full
|
||||
BuildRequires: libqb-devel
|
||||
BuildRequires: mozilla-nss-devel
|
||||
BuildRequires: zlib-devel
|
||||
%if %{with runautogen}
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
%endif
|
||||
%if %{with monitoring}
|
||||
BuildRequires: libstatgrab-devel
|
||||
%endif
|
||||
%if %{with rdma}
|
||||
BuildRequires: libibverbs-devel
|
||||
BuildRequires: librdmacm-devel
|
||||
%endif
|
||||
%if %{with snmp}
|
||||
BuildRequires: net-snmp-devel
|
||||
%endif
|
||||
%if %{with dbus}
|
||||
BuildRequires: dbus-1-devel
|
||||
%endif
|
||||
%if %{with systemd}
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
%{systemd_ordering}
|
||||
%endif
|
||||
%if %{with xmlconf}
|
||||
Requires: libxslt
|
||||
%endif
|
||||
%if %{with qdevices} || %{with qnetd}
|
||||
Requires: mozilla-nss-tools
|
||||
%endif
|
||||
%if %{with qnetd}
|
||||
BuildRequires: sed
|
||||
%endif
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
rm -f .git*
|
||||
echo %{version} > .tarball-version
|
||||
echo %{version} > .version
|
||||
|
||||
%build
|
||||
%if %{with runautogen}
|
||||
./autogen.sh
|
||||
%endif
|
||||
|
||||
%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}
|
||||
--enable-testagents \
|
||||
%endif
|
||||
%if %{with watchdog}
|
||||
--enable-watchdog \
|
||||
%endif
|
||||
%if %{with monitoring}
|
||||
--enable-monitoring \
|
||||
%endif
|
||||
%if %{with snmp}
|
||||
--enable-snmp \
|
||||
%endif
|
||||
%if %{with dbus}
|
||||
--enable-dbus \
|
||||
%endif
|
||||
%if %{with rdma}
|
||||
--enable-rdma \
|
||||
%endif
|
||||
%if %{with systemd}
|
||||
--enable-systemd \
|
||||
%endif
|
||||
%if %{with upstart}
|
||||
--enable-upstart \
|
||||
%endif
|
||||
%if %{with xmlconf}
|
||||
--enable-xmlconf \
|
||||
%endif
|
||||
%if %{with qdevices}
|
||||
--enable-qdevices \
|
||||
%endif
|
||||
%if %{with qnetd}
|
||||
--enable-qnetd \
|
||||
%endif
|
||||
--with-initddir=%{_initrddir} \
|
||||
--with-systemddir=%{_unitdir} \
|
||||
--with-upstartdir=%{_sysconfdir}/init \
|
||||
--with-tmpfilesdir=%{_tmpfilesdir}
|
||||
|
||||
make %{_smp_mflags}
|
||||
|
||||
%install
|
||||
%make_install
|
||||
|
||||
%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
|
||||
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
|
||||
# drop static libs
|
||||
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/share/doc/packages/corosync/
|
||||
mkdir -p %{buildroot}%{_fillupdir}/
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/init.d/
|
||||
install -m 0644 conf/corosync.conf.example* %{buildroot}/usr/share/doc/packages/corosync/
|
||||
mkdir -p %{buildroot}/usr/lib/corosync
|
||||
install -m 0755 init/upgrade.sh %{buildroot}/usr/lib/corosync
|
||||
rm -rf %{buildroot}/etc/corosync/corosync.conf.example*
|
||||
rm -rf %{buildroot}/etc/logrotate.d/
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
|
||||
install -m 644 init/corosync.sysconfig.example \
|
||||
%{buildroot}%{_fillupdir}/sysconfig.corosync
|
||||
install -m 0644 tools/corosync-notifyd.sysconfig.example \
|
||||
%{buildroot}%{_fillupdir}/sysconfig.corosync-notifyd
|
||||
rm -rf %{buildroot}%{localstatedir}/run/
|
||||
%if %{with qdevices}
|
||||
install -m 644 init/corosync-qdevice.sysconfig.example \
|
||||
%{buildroot}%{_fillupdir}/sysconfig.corosync-qdevice
|
||||
install -m 770 -d %{buildroot}/run/corosync-qdevice
|
||||
%endif
|
||||
|
||||
%if %{with qnetd}
|
||||
install -m 644 init/corosync-qnetd.sysconfig.example \
|
||||
%{buildroot}%{_fillupdir}/sysconfig.corosync-qnetd
|
||||
install -m 770 -d %{buildroot}/run/corosync-qnetd
|
||||
%if %{with systemd}
|
||||
sed -i -e 's/^#User=/User=/' \
|
||||
%{buildroot}%{_unitdir}/corosync-qnetd.service
|
||||
%else
|
||||
sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
|
||||
%{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description
|
||||
This package contains the Corosync Cluster Engine Executive, several default
|
||||
APIs and libraries, default configuration files, and an init script.
|
||||
|
||||
%pre
|
||||
%service_add_pre corosync.service corosync-notifyd.service
|
||||
|
||||
%post
|
||||
/usr/lib/corosync/upgrade.sh
|
||||
%{fillup_only -n corosync}
|
||||
%{fillup_only -n corosync-notifyd}
|
||||
# Upgrade
|
||||
if [ $1 -eq 2 ]; then
|
||||
# restore configured /etc/sysconfig/corosync(bsc#1155792)
|
||||
cp %{_sysconfdir}/sysconfig/corosync %{_fillupdir}/tmp.corosync_sysconfig
|
||||
fi
|
||||
|
||||
%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
|
||||
%service_del_preun corosync.service corosync-notifyd.service
|
||||
|
||||
%postun
|
||||
if [ -f %{_sysconfdir}/sysconfig/corosync ]; then
|
||||
rm %{_sysconfdir}/sysconfig/corosync
|
||||
fi
|
||||
|
||||
%posttrans
|
||||
if [ ! -f %{_sysconfdir}/sysconfig/corosync ]; then
|
||||
mv %{_fillupdir}/tmp.corosync_sysconfig %{_sysconfdir}/sysconfig/corosync
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc SECURITY
|
||||
%license LICENSE
|
||||
%{_sbindir}/corosync
|
||||
%{_sbindir}/corosync-keygen
|
||||
%{_sbindir}/corosync-cmapctl
|
||||
%{_sbindir}/corosync-cfgtool
|
||||
%{_sbindir}/corosync-cpgtool
|
||||
%{_sbindir}/corosync-quorumtool
|
||||
%{_sbindir}/corosync-notifyd
|
||||
%if %{with systemd}
|
||||
%{_sbindir}/rccorosync
|
||||
%{_sbindir}/rccorosync-notifyd
|
||||
%endif
|
||||
%{_bindir}/corosync-blackbox
|
||||
%if %{with xmlconf}
|
||||
%{_bindir}/corosync-xmlproc
|
||||
%config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
|
||||
%dir %{_datadir}/corosync
|
||||
%{_datadir}/corosync/xml2conf.xsl
|
||||
%{_mandir}/man8/corosync-xmlproc.8*
|
||||
%{_mandir}/man5/corosync.xml.5*
|
||||
%endif
|
||||
%dir %{_sysconfdir}/corosync
|
||||
%dir %{_sysconfdir}/corosync/uidgid.d
|
||||
%dir %{_datadir}/doc/corosync/
|
||||
%dir /usr/lib/corosync/
|
||||
/usr/lib/corosync/upgrade.sh
|
||||
%config(noreplace) /usr/share/doc/packages/corosync/corosync.conf.example
|
||||
%config(noreplace) /usr/share/doc/packages/corosync/corosync.conf.example.udpu
|
||||
%config(noreplace) %{_fillupdir}/sysconfig.corosync-notifyd
|
||||
%config(noreplace) %{_fillupdir}/sysconfig.corosync
|
||||
|
||||
%if %{with dbus}
|
||||
%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
|
||||
%endif
|
||||
%if %{with snmp}
|
||||
%{_datadir}/snmp/mibs/COROSYNC-MIB.txt
|
||||
%endif
|
||||
%if %{with systemd}
|
||||
%{_unitdir}/corosync.service
|
||||
%{_unitdir}/corosync-notifyd.service
|
||||
%dir %{_datadir}/corosync
|
||||
%{_datadir}/corosync/corosync
|
||||
%{_datadir}/corosync/corosync-notifyd
|
||||
%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*
|
||||
%{_mandir}/man8/corosync.8*
|
||||
%{_mandir}/man8/corosync-blackbox.8*
|
||||
%{_mandir}/man8/corosync-cmapctl.8*
|
||||
%{_mandir}/man8/corosync-keygen.8*
|
||||
%{_mandir}/man8/corosync-cfgtool.8*
|
||||
%{_mandir}/man8/corosync-cpgtool.8*
|
||||
%{_mandir}/man8/corosync-notifyd.8*
|
||||
%{_mandir}/man8/corosync-quorumtool.8*
|
||||
%{_mandir}/man5/corosync.conf.5*
|
||||
%{_mandir}/man5/votequorum.5*
|
||||
%{_mandir}/man8/cmap_keys.8*
|
||||
%{_datadir}/doc/corosync/*
|
||||
# optional testagent rpm
|
||||
#
|
||||
%if %{with testagents}
|
||||
|
||||
%package -n corosync-testagents
|
||||
Summary: The Corosync Cluster Engine Test Agents
|
||||
Group: Development/Tools/Other
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description -n corosync-testagents
|
||||
This package contains corosync test agents.
|
||||
|
||||
%files -n corosync-testagents
|
||||
%defattr(755,root,root,-)
|
||||
%dir %{_datadir}/corosync/tests
|
||||
|
||||
%{_datadir}/corosync/tests/mem_leak_test.sh
|
||||
%{_datadir}/corosync/tests/net_breaker.sh
|
||||
%{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
|
||||
%{_datadir}/corosync/tests/shm_leak_audit.sh
|
||||
%{_bindir}/cpg_test_agent
|
||||
%{_bindir}/sam_test_agent
|
||||
%{_bindir}/votequorum_test_agent
|
||||
|
||||
%endif
|
||||
|
||||
%package -n libcfg6
|
||||
Summary: Corosync configuration database library
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libcfg6
|
||||
This package contains the Corosync configuration database library.
|
||||
|
||||
%package -n libcmap4
|
||||
Summary: Corosync configuration map library
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libcmap4
|
||||
The CMAP library is used to interact with the configuration database
|
||||
used by Corosync. The library provides a mechanism to
|
||||
create/chage/remove keys, iterate over them and track changes to
|
||||
keys.
|
||||
|
||||
%package -n libcorosync_common4
|
||||
Summary: The Corosync Cluster Engine library
|
||||
# openais is indeed gone and should be uninstalled. Yes, we do not
|
||||
# provide libopenais on purpose, the package has been deleted.
|
||||
Group: System/Libraries
|
||||
Obsoletes: libopenais3 < 1.2
|
||||
Conflicts: libopenais3 < 1.2
|
||||
Obsoletes: libcorosync4 < %{version}-%{release}
|
||||
Provides: libcorosync4 = %{version}-%{release}
|
||||
|
||||
%description -n libcorosync_common4
|
||||
This package contains the central Corosync library.
|
||||
|
||||
%package -n libcpg4
|
||||
Summary: Corosync group message API
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libcpg4
|
||||
A group message API called CPG, part of Corosync. This library is
|
||||
used to create distributed applications that operate properly during
|
||||
cluster partitions, merges, and faults.
|
||||
|
||||
%package -n libquorum5
|
||||
Summary: Corosync quorum library
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libquorum5
|
||||
The quorum library is the external interface to the quorum service.
|
||||
This service is loaded into all nodes in a Corosync cluster and track
|
||||
the quorum status of a node.
|
||||
|
||||
%package -n libsam4
|
||||
Summary: Corosync Simple Availability Manager API
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libsam4
|
||||
The SAM library provide a tool to check the health of an application.
|
||||
The main purpose of SAM is to restart a local process when it fails
|
||||
to respond to a healthcheck request in a configured time interval.
|
||||
|
||||
%package -n libtotem_pg5
|
||||
Summary: Corosync Totem protocol
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libtotem_pg5
|
||||
An implementation of the Totem Single Ring Ordering and Membership
|
||||
protocol providing the Extended Virtual Synchrony model for messaging
|
||||
and membership.
|
||||
|
||||
%package -n libvotequorum8
|
||||
Summary: Corosync vote quorum library
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libvotequorum8
|
||||
The votequorum library is the external interface to the vote-based
|
||||
quorum service. This service is optionally loaded into all nodes in a
|
||||
Corosync cluster to avoid split-brain situations. It does this by
|
||||
having a number of votes assigned to each system in the cluster and
|
||||
ensuring that only when a majority of the votes are present, cluster
|
||||
operations are allowed to proceed.
|
||||
|
||||
%files -n libcfg6
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libcfg.so.*
|
||||
|
||||
%files -n libcmap4
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libcmap.so.*
|
||||
|
||||
%files -n libcpg4
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libcpg.so.*
|
||||
|
||||
%files -n libcorosync_common4
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libcorosync_common.so.*
|
||||
|
||||
%files -n libquorum5
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libquorum.so.*
|
||||
|
||||
%files -n libsam4
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libsam.so.*
|
||||
|
||||
%files -n libtotem_pg5
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libtotem_pg.so.*
|
||||
|
||||
%files -n libvotequorum8
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libvotequorum.so.*
|
||||
|
||||
%post -n libcfg6 -p /sbin/ldconfig
|
||||
%postun -n libcfg6 -p /sbin/ldconfig
|
||||
%post -n libcmap4 -p /sbin/ldconfig
|
||||
%postun -n libcmap4 -p /sbin/ldconfig
|
||||
%post -n libcorosync_common4 -p /sbin/ldconfig
|
||||
%postun -n libcorosync_common4 -p /sbin/ldconfig
|
||||
%post -n libcpg4 -p /sbin/ldconfig
|
||||
%postun -n libcpg4 -p /sbin/ldconfig
|
||||
%post -n libquorum5 -p /sbin/ldconfig
|
||||
%postun -n libquorum5 -p /sbin/ldconfig
|
||||
%post -n libsam4 -p /sbin/ldconfig
|
||||
%postun -n libsam4 -p /sbin/ldconfig
|
||||
%post -n libtotem_pg5 -p /sbin/ldconfig
|
||||
%postun -n libtotem_pg5 -p /sbin/ldconfig
|
||||
%post -n libvotequorum8 -p /sbin/ldconfig
|
||||
%postun -n libvotequorum8 -p /sbin/ldconfig
|
||||
|
||||
%package -n libcorosync-devel
|
||||
Summary: The Corosync Cluster Engine Development Kit
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libcfg6 = %{version}-%{release}
|
||||
Requires: libcmap4 = %{version}-%{release}
|
||||
Requires: libcorosync_common4 = %{version}-%{release}
|
||||
Requires: libcpg4 = %{version}-%{release}
|
||||
Requires: libqb-devel
|
||||
Requires: libquorum5 = %{version}-%{release}
|
||||
Requires: libsam4 = %{version}-%{release}
|
||||
Requires: libtotem_pg5 = %{version}-%{release}
|
||||
Requires: libvotequorum8 = %{version}-%{release}
|
||||
Requires: pkgconfig
|
||||
Provides: corosync-devel = %{version}
|
||||
Obsoletes: corosync-devel < 0.92-7
|
||||
|
||||
%description -n libcorosync-devel
|
||||
This package contains include files and man pages used to develop using
|
||||
The Corosync Cluster Engine APIs.
|
||||
|
||||
%files -n libcorosync-devel
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE
|
||||
%dir %{_includedir}/corosync/
|
||||
%{_includedir}/corosync/corodefs.h
|
||||
%{_includedir}/corosync/cfg.h
|
||||
%{_includedir}/corosync/cmap.h
|
||||
%{_includedir}/corosync/corotypes.h
|
||||
%{_includedir}/corosync/cpg.h
|
||||
%{_includedir}/corosync/hdb.h
|
||||
%{_includedir}/corosync/sam.h
|
||||
%{_includedir}/corosync/quorum.h
|
||||
%{_includedir}/corosync/votequorum.h
|
||||
%dir %{_includedir}/corosync/totem/
|
||||
%{_includedir}/corosync/totem/totem.h
|
||||
%{_includedir}/corosync/totem/totemip.h
|
||||
%{_includedir}/corosync/totem/totempg.h
|
||||
%{_libdir}/libcfg.so
|
||||
%{_libdir}/libcpg.so
|
||||
%{_libdir}/libcmap.so
|
||||
%{_libdir}/libtotem_pg.so
|
||||
%{_libdir}/libquorum.so
|
||||
%{_libdir}/libvotequorum.so
|
||||
%{_libdir}/libsam.so
|
||||
%{_libdir}/libcorosync_common.so
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
%{_mandir}/man3/cpg_*3*
|
||||
%{_mandir}/man3/quorum_*3*
|
||||
%{_mandir}/man3/votequorum_*3*
|
||||
%{_mandir}/man3/sam_*3*
|
||||
%{_mandir}/man8/cpg_overview.8*
|
||||
%{_mandir}/man8/votequorum_overview.8*
|
||||
%{_mandir}/man8/sam_overview.8*
|
||||
%{_mandir}/man3/cmap_*3*
|
||||
%{_mandir}/man8/cmap_overview.8*
|
||||
%{_mandir}/man8/quorum_overview.8*
|
||||
%post -n libcorosync-devel -p /sbin/ldconfig
|
||||
%postun -n libcorosync-devel -p /sbin/ldconfig
|
||||
|
||||
%if %{with qdevices}
|
||||
|
||||
%package -n corosync-qdevice
|
||||
Summary: The Corosync Cluster Engine Qdevice
|
||||
Group: System/Base
|
||||
Requires: corosync
|
||||
Requires: mozilla-nss-tools
|
||||
|
||||
%if %{with systemd}
|
||||
%{systemd_ordering}
|
||||
%endif
|
||||
|
||||
%description -n corosync-qdevice
|
||||
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
|
||||
|
||||
%post -n corosync-qdevice
|
||||
%{fillup_only -n corosync-qdevice}
|
||||
# Upgrade
|
||||
if [ $1 -eq 2 ]; then
|
||||
cp %{_sysconfdir}/sysconfig/corosync-qdevice %{_fillupdir}/tmp.corosync-qdevice_sysconfig
|
||||
fi
|
||||
|
||||
%if %{sles_version} > 0
|
||||
ln -s /run/corosync-qdevice /var/run/
|
||||
%endif
|
||||
%service_add_post corosync-qdevice.service
|
||||
|
||||
%preun -n corosync-qdevice
|
||||
%service_del_preun corosync-qdevice.service
|
||||
|
||||
%if %{sles_version}
|
||||
unlink /var/run/corosync-qdevice
|
||||
%endif
|
||||
|
||||
%service_del_postun corosync-qdevice.service
|
||||
|
||||
%postun -n corosync-qdevice
|
||||
if [ -f %{_sysconfdir}/sysconfig/corosync-qdevice ]; then
|
||||
rm %{_sysconfdir}/sysconfig/corosync-qdevice
|
||||
fi
|
||||
|
||||
%posttrans -n corosync-qdevice
|
||||
if [ ! -f %{_sysconfdir}/sysconfig/corosync-qdevice ]; then
|
||||
mv %{_fillupdir}/tmp.corosync-qdevice_sysconfig %{_sysconfdir}/sysconfig/corosync-qdevice
|
||||
fi
|
||||
|
||||
%files -n corosync-qdevice
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{_sysconfdir}/corosync/qdevice
|
||||
%dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net
|
||||
#change corosync-qdevice to /run as /var/run is symlink nowdays
|
||||
%ghost /run/corosync-qdevice
|
||||
%{_sbindir}/corosync-qdevice
|
||||
%{_sbindir}/corosync-qdevice-net-certutil
|
||||
%{_sbindir}/corosync-qdevice-tool
|
||||
%config(noreplace) %{_fillupdir}/sysconfig.corosync-qdevice
|
||||
%if %{with systemd}
|
||||
%{_unitdir}/corosync-qdevice.service
|
||||
%{_sbindir}/rccorosync-qdevice
|
||||
%dir %{_datadir}/corosync
|
||||
%{_datadir}/corosync/corosync-qdevice
|
||||
%endif
|
||||
%{_mandir}/man8/corosync-qdevice-tool.8*
|
||||
%{_mandir}/man8/corosync-qdevice-net-certutil.8*
|
||||
%{_mandir}/man8/corosync-qdevice.8*
|
||||
%endif
|
||||
|
||||
%if %{with qnetd}
|
||||
|
||||
%package -n corosync-qnetd
|
||||
Summary: The Corosync Cluster Engine Qdevice Network Daemon
|
||||
Group: System/Base
|
||||
Requires: mozilla-nss-tools
|
||||
Requires(pre): /usr/sbin/useradd
|
||||
|
||||
%if %{with systemd}
|
||||
%{systemd_ordering}
|
||||
%endif
|
||||
|
||||
%description -n corosync-qnetd
|
||||
This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating
|
||||
NSS certificates and an init script.
|
||||
|
||||
%pre -n corosync-qnetd
|
||||
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
|
||||
%if %{sles_version} > 0
|
||||
ln -s /run/corosync-qnetd /var/run/
|
||||
%endif
|
||||
%{fillup_only -n corosync-qnetd}
|
||||
# Upgrade
|
||||
if [ $1 -eq 2 ]; then
|
||||
cp %{_sysconfdir}/sysconfig/corosync-qnetd %{_fillupdir}/tmp.corosync-qnetd_sysconfig
|
||||
fi
|
||||
|
||||
%service_add_post corosync-qnetd.service
|
||||
|
||||
%preun -n corosync-qnetd
|
||||
%service_del_preun corosync-qnetd.service
|
||||
|
||||
%if %{sles_version} > 0
|
||||
unlink /var/run/corosync-qnetd
|
||||
%endif
|
||||
|
||||
%service_del_postun corosync-qnetd.service
|
||||
|
||||
%postun -n corosync-qnetd
|
||||
if [ -f %{_sysconfdir}/sysconfig/corosync-qnetd ]; then
|
||||
rm %{_sysconfdir}/sysconfig/corosync-qnetd
|
||||
fi
|
||||
|
||||
%posttrans -n corosync-qnetd
|
||||
if [ ! -f %{_sysconfdir}/sysconfig/corosync-qnetd ]; then
|
||||
mv %{_fillupdir}/tmp.corosync-qnetd_sysconfig %{_sysconfdir}/sysconfig/corosync-qnetd
|
||||
fi
|
||||
|
||||
%files -n corosync-qnetd
|
||||
%defattr(-,root,root,-)
|
||||
%dir %config(noreplace) %attr(750, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
|
||||
#change corosync-qnetd to /run as /var/run is just symlink nowadays
|
||||
%ghost %attr (750, coroqnetd, coroqnetd) /run/corosync-qnetd
|
||||
%{_bindir}/corosync-qnetd
|
||||
%{_bindir}/corosync-qnetd-certutil
|
||||
%{_bindir}/corosync-qnetd-tool
|
||||
%config(noreplace) %{_fillupdir}/sysconfig.corosync-qnetd
|
||||
%if %{with systemd}
|
||||
%{_unitdir}/corosync-qnetd.service
|
||||
%{_sbindir}/rccorosync-qnetd
|
||||
%dir %{_datadir}/corosync
|
||||
%{_datadir}/corosync/corosync-qnetd
|
||||
%endif
|
||||
%{_mandir}/man8/corosync-qnetd-tool.8*
|
||||
%{_mandir}/man8/corosync-qnetd-certutil.8*
|
||||
%{_mandir}/man8/corosync-qnetd.8*
|
||||
%endif
|
||||
|
||||
%changelog
|
@ -0,0 +1,24 @@
|
||||
diff -Naur corosync-2.4.5/exec/ipc_glue.c corosync-2.4.5-new/exec/ipc_glue.c
|
||||
--- corosync-2.4.5/exec/ipc_glue.c 2019-07-30 20:26:27.000000000 +0800
|
||||
+++ corosync-2.4.5-new/exec/ipc_glue.c 2019-08-13 13:54:38.187443967 +0800
|
||||
@@ -272,7 +272,7 @@
|
||||
struct cs_ipcs_conn_context *context;
|
||||
char proc_name[32];
|
||||
struct qb_ipcs_connection_stats stats;
|
||||
- int32_t size = sizeof(struct cs_ipcs_conn_context);
|
||||
+ size_t size = sizeof(struct cs_ipcs_conn_context);
|
||||
char key_name[ICMAP_KEYNAME_MAXLEN];
|
||||
int set_client_pid = 0;
|
||||
int set_proc_name = 0;
|
||||
diff -Naur corosync-2.4.5/include/corosync/coroapi.h corosync-2.4.5-new/include/corosync/coroapi.h
|
||||
--- corosync-2.4.5/include/corosync/coroapi.h 2019-07-30 20:26:27.000000000 +0800
|
||||
+++ corosync-2.4.5-new/include/corosync/coroapi.h 2019-08-13 13:55:26.031711198 +0800
|
||||
@@ -494,7 +494,7 @@
|
||||
unsigned short priority; /* Lower priority are loaded first, unloaded last.
|
||||
* 0 is a special case which always loaded _and_ unloaded last
|
||||
*/
|
||||
- unsigned int private_data_size;
|
||||
+ size_t private_data_size;
|
||||
enum cs_lib_flow_control flow_control;
|
||||
enum cs_lib_allow_inquorate allow_inquorate;
|
||||
char *(*exec_init_fn) (struct corosync_api_v1 *);
|
Loading…
Reference in New Issue
Block a user