]> git.proxmox.com Git - mirror_corosync.git/log
mirror_corosync.git
11 years ago[PATCH] Replace freopen with open/dup2 when daemonizing
Christine Caulfield [Tue, 10 Sep 2013 14:33:31 +0000 (15:33 +0100)]
[PATCH] Replace freopen with open/dup2 when daemonizing

This patch replaces the existing freopen method of
forcing stdin/out/err to /dev/null with the more
usual system of open/dup2.

While I don't like posting patches I don't fully understand,
this patch seems to fix a problem where stdout/err get
assigned to a socket causing double logging output
on systemd.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoAdd log message to exit signal handler
Christine Caulfield [Tue, 3 Sep 2013 13:04:50 +0000 (14:04 +0100)]
Add log message to exit signal handler

I've seen a few instances where corosync has shut down for
apparently 'no reason'. In fact most of the time the shutdown
has been caused by an external source (often an init script)
but it's not been obvious what has happened and people
implicate the deamon

This patch simply adds a log message to the signal handler
when it is called so that the cause of the shutdown is obvious.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoicmap: Add map copy function
Jan Friesse [Wed, 28 Aug 2013 15:35:05 +0000 (17:35 +0200)]
icmap: Add map copy function

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoicmap: Add function to return item data pointer
Jan Friesse [Wed, 28 Aug 2013 11:50:44 +0000 (13:50 +0200)]
icmap: Add function to return item data pointer

icmap_get_r is now implemented using this function. Function is not very
safe tho defined as static.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoicmap: Fix value len checking for strings
Jan Friesse [Wed, 28 Aug 2013 08:40:06 +0000 (10:40 +0200)]
icmap: Fix value len checking for strings

Implementation should allow pass only parts of string (shorten string)
and must prohibit reading of uninitialized memory.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoicmap: Add function to return global icmap
Jan Friesse [Tue, 27 Aug 2013 13:32:30 +0000 (15:32 +0200)]
icmap: Add function to return global icmap

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoicmap: Allow multiple icmap instances
Jan Friesse [Thu, 22 Aug 2013 14:53:03 +0000 (16:53 +0200)]
icmap: Allow multiple icmap instances

Patch adds reentrant version of most of functions (with exception of RO
flags support and tracking) to allow multiple icmap instances existence
inside corosync.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoFix scheduler pause-detection timeout
Michael Chapman [Mon, 19 Aug 2013 01:30:15 +0000 (01:30 +0000)]
Fix scheduler pause-detection timeout

qb_loop_timer_add expects the timeout to be in nanoseconds, but we were
passing the value in milliseconds. Scale the timeout appropriately.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoRemove dir pragma for xml2conf.xsl in specfile v2.3.1
Jan Friesse [Wed, 10 Jul 2013 09:46:53 +0000 (11:46 +0200)]
Remove dir pragma for xml2conf.xsl in specfile

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocts: Update DC_IDLE pattern
Jan Friesse [Tue, 9 Jul 2013 09:00:40 +0000 (11:00 +0200)]
cts: Update DC_IDLE pattern

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
11 years agoUse restart policy in the corosync-notifyd unit
Kazunori INOUE [Fri, 5 Jul 2013 09:50:38 +0000 (18:50 +0900)]
Use restart policy in the corosync-notifyd unit

Signed-off-by: Kazunori INOUE <inouekazu@intellilink.co.jp>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoipc_glue: proper ref counting during service connection iteration
David Vossel [Tue, 2 Jul 2013 23:49:47 +0000 (18:49 -0500)]
ipc_glue: proper ref counting during service connection iteration

Signed-off-by: David Vossel <dvossel@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoipc_glue: Remove connection unref with no matching reference.
David Vossel [Tue, 2 Jul 2013 20:36:43 +0000 (15:36 -0500)]
ipc_glue: Remove connection unref with no matching reference.

We don't reference the connection object on creation, so there
is on reason to dereference it on disconnect.

Signed-off-by: David Vossel <dvossel@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoipc_glue: Fixes connection ref count leak
David Vossel [Tue, 2 Jul 2013 20:17:29 +0000 (15:17 -0500)]
ipc_glue: Fixes connection ref count leak

Signed-off-by: David Vossel <dvossel@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agosystemd: fix typo in unit file
Kazunori INOUE [Fri, 28 Jun 2013 07:32:52 +0000 (16:32 +0900)]
systemd: fix typo in unit file

Signed-off-by: Kazunori INOUE <inouekazu@intellilink.co.jp>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agonotifyd: fix handle dispatch functions results
Kazunori INOUE [Fri, 28 Jun 2013 07:01:03 +0000 (16:01 +0900)]
notifyd: fix handle dispatch functions results

Signed-off-by: Kazunori INOUE <inouekazu@intellilink.co.jp>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoThe corosync message "A processor joined or left the membership" is
Christine Caulfield [Thu, 27 Jun 2013 13:44:46 +0000 (14:44 +0100)]
The corosync message "A processor joined or left the membership" is
vague and unhelpful. People have to look for the following quorum
message and try to deduce which nodes have joined or left from that
and past membership messages, even though the routine printing the
message already has this information to hand.

This patch fixes that message so that it prints the nodeids of the nodes
that have joined/left the cluster.

Signed-Off-By: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-By: Jan Friesse <jfriesse@redhat.com>
11 years agoLog: Output parse errors to syslog
Jan Friesse [Thu, 20 Jun 2013 09:59:50 +0000 (11:59 +0200)]
Log: Output parse errors to syslog

When corosync was started in daemon mode and there was parse error, no
way existed how to find out what happened (this is usual situation with
systemd enabled systems). Solution seems to be output to syslog by
default.

Also redundant line with setting logsys is removed because it's no
longer needed, because FORK and THREADED mode options has no longer
effect. FORK is handled by libqb by default and THREADED mode is forced
by calling logsys_thread_start.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agototemconfig: Prevent leak of cluster_name str
Jan Friesse [Tue, 18 Jun 2013 13:43:40 +0000 (15:43 +0200)]
totemconfig: Prevent leak of cluster_name str

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoservice: Fix memleak in service_unlink_and_exit
Jan Friesse [Tue, 18 Jun 2013 13:38:06 +0000 (15:38 +0200)]
service: Fix memleak in service_unlink_and_exit

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoFix patch for corosync.conf.5
Eric Raymond [Thu, 20 Jun 2013 14:09:50 +0000 (16:09 +0200)]
Fix patch for corosync.conf.5

he markup around an example is impossible to lift to XML or HTML
cleanly. Simplifying it fixes the problem.

Signed-off-by: Eric Raymond <esr@thyrsus.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agocpg: Set umask in memory_map function
Jan Friesse [Thu, 13 Jun 2013 14:21:09 +0000 (16:21 +0200)]
cpg: Set umask in memory_map function

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoipc_glue: Check service name len
Jan Friesse [Thu, 13 Jun 2013 14:11:45 +0000 (16:11 +0200)]
ipc_glue: Check service name len

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agoipc_glue: Introduce constant for service name len
Jan Friesse [Thu, 13 Jun 2013 14:10:57 +0000 (16:10 +0200)]
ipc_glue: Introduce constant for service name len

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agocfg: Check interface status and name length
Jan Friesse [Thu, 13 Jun 2013 13:47:38 +0000 (15:47 +0200)]
cfg: Check interface status and name length

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agocfg: Check number of interfaces
Jan Friesse [Thu, 13 Jun 2013 13:43:11 +0000 (15:43 +0200)]
cfg: Check number of interfaces

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agocfg: Introduce CFG_MAX constants
Jan Friesse [Thu, 13 Jun 2013 13:40:30 +0000 (15:40 +0200)]
cfg: Introduce CFG_MAX constants

Instead of magic numbers, use constant.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agototemrrp: Make status string shorter
Jan Friesse [Thu, 13 Jun 2013 13:27:57 +0000 (15:27 +0200)]
totemrrp: Make status string shorter

Status string should be same lenght as needed for cfg
ringstatusget function.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agototem: Don't leak instance variable on crypto fail
Jan Friesse [Mon, 17 Jun 2013 14:27:55 +0000 (16:27 +0200)]
totem: Don't leak instance variable on crypto fail

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agototemudpu: Handle fd leak in totemudpu
Jan Friesse [Mon, 17 Jun 2013 14:18:55 +0000 (16:18 +0200)]
totemudpu: Handle fd leak in totemudpu

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agototemconfig: Check length of rrp_mode string
Jan Friesse [Mon, 17 Jun 2013 14:11:29 +0000 (16:11 +0200)]
totemconfig: Check length of rrp_mode string

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocoroparse: Ensure that config items fits into cmap
Jan Friesse [Fri, 14 Jun 2013 09:35:44 +0000 (11:35 +0200)]
coroparse: Ensure that config items fits into cmap

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocpg: Check cpg zc buffer path name length
Jan Friesse [Fri, 14 Jun 2013 08:26:18 +0000 (10:26 +0200)]
cpg: Check cpg zc buffer path name length

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agovotequorum: Prevent leak in qdevice_is_configured
Jan Friesse [Thu, 13 Jun 2013 13:19:18 +0000 (15:19 +0200)]
votequorum: Prevent leak in qdevice_is_configured

Also LEAVE from function is now properly logged.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoipc_cfg: Make coverity happy
Jan Friesse [Wed, 12 Jun 2013 14:59:49 +0000 (16:59 +0200)]
ipc_cfg: Make coverity happy

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoInitialize error variable in ykd_init
Jan Friesse [Wed, 12 Jun 2013 14:37:54 +0000 (16:37 +0200)]
Initialize error variable in ykd_init

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoInitialize node_found in nodelist_to_interface fun
Jan Friesse [Wed, 12 Jun 2013 14:35:47 +0000 (16:35 +0200)]
Initialize node_found in nodelist_to_interface fun

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoInitialize item in cmap_mcast_send
Jan Friesse [Wed, 12 Jun 2013 14:34:36 +0000 (16:34 +0200)]
Initialize item in cmap_mcast_send

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocmapctl: Remove unnecessary access check
Jan Friesse [Wed, 12 Jun 2013 14:31:18 +0000 (16:31 +0200)]
cmapctl: Remove unnecessary access check

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agovotequrorum: Assert sender nodeid is known
Jan Friesse [Wed, 12 Jun 2013 14:25:49 +0000 (16:25 +0200)]
votequrorum: Assert sender nodeid is known

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoquorumtool: Properly check nodeid cli param
Jan Friesse [Wed, 12 Jun 2013 14:09:26 +0000 (16:09 +0200)]
quorumtool: Properly check nodeid cli param

Return value of strtol can be negative, but result was assigned to
unsigned integer. To make check correct, result is first assigned to
signed variable, checked, and then assigned to unsigned variable.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoHandle errors when getting SC_PAGESIZE
Jan Friesse [Wed, 12 Jun 2013 14:06:08 +0000 (16:06 +0200)]
Handle errors when getting SC_PAGESIZE

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoCheck result of logsys_subsys_create
Jan Friesse [Wed, 12 Jun 2013 13:50:40 +0000 (15:50 +0200)]
Check result of logsys_subsys_create

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoCheck logsys_format_set result in logsys setup
Jan Friesse [Wed, 12 Jun 2013 09:39:11 +0000 (11:39 +0200)]
Check logsys_format_set result in logsys setup

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoUse proper totem_ip_address size in memset
Jan Friesse [Tue, 11 Jun 2013 15:47:41 +0000 (17:47 +0200)]
Use proper totem_ip_address size in memset

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoFree icmap strings in logconfig
Jan Friesse [Tue, 11 Jun 2013 15:44:53 +0000 (17:44 +0200)]
Free icmap strings in logconfig

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoProperly break MAIN_CP_CB_DATA_STATE_QDEVICE state
Jan Friesse [Tue, 11 Jun 2013 14:57:39 +0000 (16:57 +0200)]
Properly break MAIN_CP_CB_DATA_STATE_QDEVICE state

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoDo not dereference format_buffer when it's NULL
Jan Friesse [Tue, 11 Jun 2013 14:56:13 +0000 (16:56 +0200)]
Do not dereference format_buffer when it's NULL

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoCheck icmap str get for clustername
Jan Friesse [Tue, 11 Jun 2013 14:48:44 +0000 (16:48 +0200)]
Check icmap str get for clustername

Even this check is really not needed, it's nice to have it and on fault
ensure that cluster_name is really NULL.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoHandle dispatch functions results
Jan Friesse [Tue, 11 Jun 2013 14:16:52 +0000 (16:16 +0200)]
Handle dispatch functions results

On error, exit corosync-notifyd properly.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoProperly check result of stat func in coroparse
Jan Friesse [Tue, 11 Jun 2013 13:54:12 +0000 (15:54 +0200)]
Properly check result of stat func in coroparse

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agotestcpg: Check length of input group name
Jan Friesse [Thu, 6 Jun 2013 15:31:50 +0000 (17:31 +0200)]
testcpg: Check length of input group name

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocommon ta: Close client sockets
Jan Friesse [Thu, 6 Jun 2013 15:22:01 +0000 (17:22 +0200)]
common ta: Close client sockets

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocommon ta: Close listener socket
Jan Friesse [Thu, 6 Jun 2013 15:21:44 +0000 (17:21 +0200)]
common ta: Close listener socket

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agotest sam: Free temp str allocated by cmap
Jan Friesse [Thu, 6 Jun 2013 15:06:20 +0000 (17:06 +0200)]
test sam: Free temp str allocated by cmap

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agosam test agent: Assert results of send func
Jan Friesse [Thu, 6 Jun 2013 14:21:42 +0000 (16:21 +0200)]
sam test agent: Assert results of send func

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agovotequorum test agent: Assert results of send func
Jan Friesse [Thu, 6 Jun 2013 14:17:13 +0000 (16:17 +0200)]
votequorum test agent: Assert results of send func

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocpg test agent: Test len of name for cpg_join
Jan Friesse [Thu, 6 Jun 2013 14:04:46 +0000 (16:04 +0200)]
cpg test agent: Test len of name for cpg_join

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocpg test agent: Cfg shutdown flag is not bitfield
Jan Friesse [Thu, 6 Jun 2013 14:00:10 +0000 (16:00 +0200)]
cpg test agent: Cfg shutdown flag is not bitfield

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocpg test agent: Assert results of send function
Jan Friesse [Thu, 6 Jun 2013 13:54:53 +0000 (15:54 +0200)]
cpg test agent: Assert results of send function

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocpg test agent: Fix typo in assert
Jan Friesse [Thu, 6 Jun 2013 13:39:46 +0000 (15:39 +0200)]
cpg test agent: Fix typo in assert

Assert should compare rc, instead of setting it.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoRename make target coverity
Jan Friesse [Thu, 6 Jun 2013 13:34:40 +0000 (15:34 +0200)]
Rename make target coverity

Makefile target "coverity" is renamed to coverity-aggressive, and target
coverity is defined as a little less aggressive.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoAllow corotypes.h to be included from C++ code.
Michael van der Westhuizen [Mon, 20 May 2013 21:56:02 +0000 (22:56 +0100)]
Allow corotypes.h to be included from C++ code.

11 years agoRemove unnecessary mmap in cpg
Jan Friesse [Mon, 20 May 2013 13:54:02 +0000 (15:54 +0200)]
Remove unnecessary mmap in cpg

Code for zero-copy in cpg does following mmaps:
- Mmap anonymous, private memory to some address (-> malloc)
- Mmap shared memory of fd to address returned by first mmap
  (effectively shadows first mapping)

This is not necessary and only one mapping is needed.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoInstall sysconfig/corosync-notifyd in specfile
Jan Friesse [Tue, 16 Apr 2013 14:59:25 +0000 (16:59 +0200)]
Install sysconfig/corosync-notifyd in specfile

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoImprove corosync-notifyd example
Jan Friesse [Tue, 16 Apr 2013 14:08:24 +0000 (16:08 +0200)]
Improve corosync-notifyd example

Example now contains default option -d, so corosync-notifyd init script
don't fall. Also description is improved a little bit.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoFix a typo in README.recovery
Masatake YAMATO [Fri, 12 Apr 2013 05:16:12 +0000 (14:16 +0900)]
Fix a typo in README.recovery

Fix a typo.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoAdd Upstart job configuration file
Kazunori INOUE [Wed, 10 Apr 2013 14:48:18 +0000 (16:48 +0200)]
Add Upstart job configuration file

Signed-off-by: Kazunori INOUE <inouekazu@intellilink.co.jp>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoDetect big scheduling pauses
Jan Friesse [Mon, 8 Apr 2013 07:57:25 +0000 (09:57 +0200)]
Detect big scheduling pauses

Add poll timer scheduler to be called 3 times per token timeout.
If poll timer was not called for more then 0.8 * token timeout, it means
corosync process was not scheduled and ether token_timeout should be
increased or load should be reduced (useful for VM, where host is
overcommitted so VM is not scheduled as expected).

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoAdded checks for "--as-needed" and "--version-script" linker flags.
Andrei Belov [Wed, 3 Apr 2013 09:36:53 +0000 (13:36 +0400)]
Added checks for "--as-needed" and "--version-script" linker flags.

This makes possible to build Corosync from sources on SunOS 5.11,
Mac OS X 10.8.3 and probably other systems with non-GNU linker.

Signed-off-by: Andrei Belov <defanator@gmail.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoSupport for numerical uid/gid
Jan Friesse [Fri, 29 Mar 2013 07:00:25 +0000 (08:00 +0100)]
Support for numerical uid/gid

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agobuild: pass enable options to "make rpm" from configure
Yuichi SEINO [Mon, 25 Mar 2013 08:06:28 +0000 (17:06 +0900)]
build: pass enable options to "make rpm" from configure

Signed-off-by: Yuichi SEINO <seino.cluster2@gmail.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoImproved POSIX-compliant handling of getpwnam_r() and getgrnam_r().
Andrei Belov [Thu, 28 Mar 2013 14:24:41 +0000 (14:24 +0000)]
Improved POSIX-compliant handling of getpwnam_r() and getgrnam_r().

Signed-off-by: Andrei Belov <defanator@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoMake cts work with pacemaker 1.1.9
Jan Friesse [Wed, 27 Mar 2013 16:30:02 +0000 (17:30 +0100)]
Make cts work with pacemaker 1.1.9

This is counterpart of adcc21a30c70a40861736bc9d902c2ef2d4b42c4 in
pacemaker.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
11 years agototempg: Make iov_delv local variable
Jan Friesse [Wed, 6 Mar 2013 12:50:49 +0000 (13:50 +0100)]
totempg: Make iov_delv local variable

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocfgtool: Retry shutdown on CS_ERR_TRY_AGAIN
Jan Friesse [Wed, 6 Mar 2013 12:42:09 +0000 (13:42 +0100)]
cfgtool: Retry shutdown on CS_ERR_TRY_AGAIN

It may be nice to deliver macro cs_repeat as default in some include
file.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocts: Output nodeid consistently as unsigned int
Jan Friesse [Wed, 20 Mar 2013 10:45:43 +0000 (11:45 +0100)]
cts: Output nodeid consistently as unsigned int

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoConvert the nodeid byte order to be aligned with network order
Xia Li [Tue, 19 Mar 2013 07:08:13 +0000 (07:08 +0000)]
Convert the nodeid byte order to be aligned with network order

When using corosync with clear_node_high_bit setting to yes,
the highest bit is cleared.  When all the cluster nodes are in
one subnet, we probably configure the IP addresses as follows:

node1: 147.2.207.64
node2: 147.2.207.192

If the byte order of the nodeid is little endian, wiping off the
highest bit will make the two nodes have the same nodeid!

This patch fixes this by converting the nodeid to network order.

Signed-off-by: Xia Li <xli@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoHandle ERANGE from getpwnam_r / getgrnam_r
Jeremy Fitzhardinge [Fri, 8 Mar 2013 00:56:54 +0000 (16:56 -0800)]
Handle ERANGE from getpwnam_r / getgrnam_r

These functions return ERANGE if the supplied buffer is too small to
fit a line.  Try doubling the buffer a few times until it works.

11 years agobuild: make --disable-testagents work
Michael Chapman [Mon, 11 Feb 2013 03:47:27 +0000 (03:47 +0000)]
build: make --disable-testagents work

The --disable-testagents option sets enable_testagents to "no". This
variable should always be explicitly tested against "yes", not just
that it is non-empty.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoHandle unexpected closing brace in config file
Jan Friesse [Thu, 31 Jan 2013 13:56:18 +0000 (14:56 +0100)]
Handle unexpected closing brace in config file

If configuration file contains closing brace before opening brace
at top level, configuration parsing is stopped and file is not
completely parsed. Solution is to detect extra closing brace and display
error.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoHandle colon in configuration file
Jan Friesse [Wed, 30 Jan 2013 12:40:52 +0000 (13:40 +0100)]
Handle colon in configuration file

If colon was entered as part of value on end of value, it is deleted.
This makes impossible to enter (legal) IPv6 address ending with :: (like
fed0::).

Also when line contains both brace and colon, it is parsed twice (first
as key = value and second as start of section). This is handled by
continue in if section.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agovotequorum: port to sync API (take 2)
Fabio M. Di Nitto [Wed, 30 Jan 2013 12:34:37 +0000 (13:34 +0100)]
votequorum: port to sync API (take 2)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agocrypto config: update man pages and examples v2.3.0
Fabio M. Di Nitto [Mon, 14 Jan 2013 11:06:47 +0000 (12:06 +0100)]
crypto config: update man pages and examples

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agototemconfig: enforce hmac config when crypto is enabled
Fabio M. Di Nitto [Mon, 14 Jan 2013 11:02:21 +0000 (12:02 +0100)]
totemconfig: enforce hmac config when crypto is enabled

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agolog: move Corosync started log messages
Kazunori INOUE [Thu, 10 Jan 2013 08:21:25 +0000 (08:21 +0000)]
log: move Corosync started log messages

"Corosync Cluster Engine ... started" message is shown after
logsys is full configured.

Signed-off-by: Kazunori INOUE <inouekazu@intellilink.co.jp>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agocrypto: drop < 2.3 protocols and onwire compat
Fabio M. Di Nitto [Mon, 14 Jan 2013 10:45:39 +0000 (11:45 +0100)]
crypto: drop < 2.3 protocols and onwire compat

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agototemcrypto: fix hmac key initialization
Fabio M. Di Nitto [Mon, 14 Jan 2013 10:12:48 +0000 (11:12 +0100)]
totemcrypto: fix hmac key initialization

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoMove qb_loop creation after daemonization v2.2.0
Jan Friesse [Wed, 12 Dec 2012 08:25:18 +0000 (09:25 +0100)]
Move qb_loop creation after daemonization

Creating qb_loop before daemonization is not problem for poll or epoll
type loops, but it's problem for kqueue, because kqueue is not shared
in child with parent after fork.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agocmap: Handle NULL params in few more functions
Jan Friesse [Thu, 6 Dec 2012 07:48:28 +0000 (08:48 +0100)]
cmap: Handle NULL params in few more functions

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoAdd option to specify ip version
Jan Friesse [Mon, 3 Dec 2012 10:42:05 +0000 (11:42 +0100)]
Add option to specify ip version

Default is ipv4.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoAdd waiting_trans_ack also to fragmentation layer
Jan Friesse [Wed, 7 Nov 2012 16:51:15 +0000 (17:51 +0100)]
Add waiting_trans_ack also to fragmentation layer

Patch for support waiting_trans_ack may fail if there is synchronization
happening between delivery of fragmented message. In such situation,
fragmentation layer is waiting for message with correct number, but it
will never arrive.

Solution is to handle (callback) change of waiting_trans_ack and use
different queue.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoHandle segfault in backlog_get
Jan Friesse [Wed, 7 Nov 2012 15:56:33 +0000 (16:56 +0100)]
Handle segfault in backlog_get

If instance->memb_state is not OPERATION or RECOVERY, we was passing NULL
to cs_queue_used call.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoFix problem with sync operations under very rare circumstances
Steven Dake [Wed, 7 Nov 2012 15:45:12 +0000 (16:45 +0100)]
Fix problem with sync operations under very rare circumstances

This patch creates a special message queue for synchronization messages.
This prevents a situation in which messages are queued in the
new_message_queue but have not yet been originated from corrupting the
synchronization process.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agoFix handling of NULL parameters in cmap
Jan Friesse [Thu, 22 Nov 2012 09:26:12 +0000 (10:26 +0100)]
Fix handling of NULL parameters in cmap

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
11 years agototemcrypto: implement crypto packet format 2.2 and crypto_compat: config opt
Fabio M. Di Nitto [Thu, 22 Nov 2012 09:27:49 +0000 (10:27 +0100)]
totemcrypto: implement crypto packet format 2.2 and crypto_compat: config opt

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoUpdate .gitignore files
Fabio M. Di Nitto [Wed, 21 Nov 2012 09:20:46 +0000 (10:20 +0100)]
Update .gitignore files

 Untracked files:
   (use "git add <file>..." to include in what will be committed)

       compile
       init/corosync
       init/corosync-notifyd
       test/ploadstart

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agocorosync to start in infiniband + redundant ring active/passive mode
Evgeny Barskiy [Mon, 19 Nov 2012 11:24:49 +0000 (11:24 +0000)]
corosync to start in infiniband + redundant ring active/passive mode

Corosync now works with infiniband transport in any redundant ring mode

Signed-off-by: Evgeny Barskiy <barskiy@rts.ru>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agovotequorum: fix handling of expected_votes/votes changes from cmapctl
Fabio M. Di Nitto [Tue, 20 Nov 2012 14:38:09 +0000 (15:38 +0100)]
votequorum: fix handling of expected_votes/votes changes from cmapctl

and allow natural selection to take place....

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
11 years agoquorum-tool: use option to generate machine parsable output
Fabio M. Di Nitto [Tue, 20 Nov 2012 08:19:46 +0000 (09:19 +0100)]
quorum-tool: use option to generate machine parsable output

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>