Commit Graph

95 Commits

Author SHA1 Message Date
Angus Salkeld
7004457014 notifyd: dispatch only one message at a time.
This is avoid getting stuck in the dispatch processing
messages when the user is trying to shutdown the service.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-03-21 09:24:01 -07:00
Angus Salkeld
0ad2494ae7 Fix some "set but not used" warnings [-Wunused-but-set-variable]
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-03-16 07:13:42 +11:00
Russell Bryant
a609f79f1f Ensure that strings are null terminated after strncpy().
From the strcpy(3) man page, the following warning is given:
  The strncpy() function is similar, except that at most n bytes of src
  are  copied.  Warning: If there is no null byte among the first n bytes
  of src, the string placed in dest will not be null-terminated.

The current corosync code base does not take this warning into account
when using strncpy, potentially resulting in non-null terminated strings.

Signed-off-by: Russell Bryant <russell@russellbryant.net>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-03-07 08:30:03 -06:00
Russell Bryant
1be0c3bdc6 Add -l option to corosync-keygen.
This option (-l or --less-secure) causes corosync-keygen to read from
/dev/urandom instead of /dev/random to ensure that no input is required
from the user.  It may be useful when this command is used from a
script.

Signed-off-by: Russell Bryant <russell@russellbryant.net>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-03-05 10:02:57 -06:00
Steven Dake
d9b2f3937b snmp: Allow buildling of corosync on already existing older install of corosync
When building corosync against older libraries already installed on the system,
the corosync-notifyd application uses the wrong Makefile.am commands.  This
results in the SNMPLIBS (which includes -L/usr/lib64) coming before the proper
LDADD flags.  The result is an inability to compile on an already existing
installation.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-02-24 15:23:37 -07:00
Jan Friesse
12163b62d2 corosync-fplay: use uint32_t and remove bit-shift
The flight recorder records all data in 32 bit words. Use uint32_t type
rather then unsigned int. Also remove bit-shift with multiply by sizeof
uint32_t.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-02-23 13:31:38 +01:00
Jan Friesse
d3e9382d57 corosync-fplay: Use size_t length mod in printf
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-02-23 13:31:31 +01:00
Jan Friesse
7b0517f5e9 corosync-fplay: handle too large rec_size
Corrupted files may contain items with rec_size larger then g_record
buffer and/or flt_data_size.

Also g_record array size is now defined as constant.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-02-22 10:11:48 +01:00
Angus Salkeld
f2a961d155 Make node state a string (not an integer)
Ryan noticed this inconsistency, all other status's
are string so this should be too.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Seven Dake <sdake@redhat.com>
Reviewed-by: Ryan O'Hara <rohara@redhat.com>
2011-02-08 08:10:30 +11:00
Lon Hohberger
cca89e0a06 Match up MIB to notifyd & add SNMP quorum events
Signed-off-by: Lon Hohberger <lhh@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-02-04 09:48:16 -07:00
Angus Salkeld
2a568d6e79 Add dbus and snmp notifier
This is to send dbus events on major cluster events:
 - membership changes
 - application connect/dissconnet from corosync
 - quorum changes

dbus events can then be converted into snmp traps by foghorn or
corosync-notifyd can be run to directly send snmp traps.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Signed-off-by: Lon Hohberger <lhh@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Russell Bryant <russell@russellbryant.net>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2011-02-04 09:47:35 -07:00
Angus Salkeld
20d545e946 remove unused function declaration
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-01-12 09:42:24 +11:00
Angus Salkeld
6f098bba1d fix timersub warning on freebsd
Make them all protected by #ifndef timersub

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-01-12 09:42:24 +11:00
Steven Dake
0730d997b1 Merge branch 'master', remote branch 'origin/master' 2010-11-10 07:08:54 -07:00
Angus Salkeld
f0104b6d31 Add .gitignore files.
Otherwise "git status" is a pain.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@edhat.com>
2010-10-21 07:43:46 -07:00
Steven Dake
46c212bd2a Add -n option to corosync-objctl to create a new object/key combo
Find an existing parent object and add the last object/key name of the command
to the object database.  This allows the runtime addition of ip addresses to
the list of IPs corosync knows about for the purpose of the UDPU transport mode.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-21 11:26:16 +11:00
Angus Salkeld
24fd548828 add float and double support to corosync-objctl
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3044 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-25 06:47:30 +00:00
Angus Salkeld
c94dba0b49 cov 10385: assigning signed int to unsigned variable
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2828 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-14 02:07:39 +00:00
Angus Salkeld
8ebe03efd5 diags: add a mechanism to trigger the writing the flight data
trigger the dumping of flight data using:
 corosync-objctl -w runtime.blackbox.dump_flight_data=anything
trigger the dumping of state using:
 corosync-objctl -w runtime.blackbox.dump_state=anything

then read the flight data as usual:
 corosync-fplay

This patch includes a wrapper script called:
 corosync-blackbox



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2799 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-04 00:56:25 +00:00
Angus Salkeld
1e17751d0d Remove warnings.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2682 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-11 00:27:04 +00:00
Angus Salkeld
a1a5e21975 COVERITY 17: fix exit handling in show_votes().
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2548 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-22 23:59:51 +00:00
Angus Salkeld
28f7c1e51f COVERITY 13: prevent buffer overrun in quorum-tool.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2546 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-22 06:34:11 +00:00
Angus Salkeld
97ed934966 Fix the OSX build (broken by stats patches)
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2521 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-13 08:13:53 +00:00
Angus Salkeld
e2a39ede1d Remove silly warning in corosync-objdb
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2516 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-12 17:29:19 +00:00
Angus Salkeld
73b7aa19bb Add value types to objdb keys.
This allows you to create a key with a know type.
And then get the type with the key value.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2511 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-10 03:20:38 +00:00
Christine Caulfield
7f3da97ca3 Really add corosync-quorumtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2407 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-08 08:19:11 +00:00
Christine Caulfield
6f3fabe398 Add corosync-quorumtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2406 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-08 08:14:58 +00:00
Fabio M. Di Nitto
8dad75ef05 Fix corosync-tools linking
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2402 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-07 07:24:15 +00:00
Jan Friesse
e25f36b653 Real add of corosync-cpgtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2401 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-31 15:58:12 +00:00
Jan Friesse
bc5031ff2f Initial version of corosync-cpgtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2400 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-31 09:57:20 +00:00
Steven Dake
69ced80179 Request user enter characters into terminal if entropy pool is empty for keygen
rather then exiting without creating an auth key.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2387 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-17 17:18:26 +00:00
Angus Salkeld
42d3c01cb1 add "-p" option to corosync-objctl
This just adds a "-p" option to corosync-objctl.

So you can do the following (like sysctl).

corosync-objctl -p /path/to/object.conf



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2308 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-27 04:37:51 +00:00
Fabio M. Di Nitto
2135d91c27 Fix handling of sysconfdir
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2265 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-19 07:02:55 +00:00
Fabio M. Di Nitto
9a94d633cf flight recorder: switch from int to bytes for requested allocation
The flight recoder buffer size as specified in LOGSYS_DECLARE_SYSTEM
or _logsys_rec_init was expressed in number of ints. A developer asking
to allocate 512K would get a 2M allocation on a machine with sizeof(int) = 4.

This is confusing and the patch addresses it:

- rename rec_size to fltsize for external API (no type change),
  because rec_size is used many times internally for other reasons
  and it can be confusing.

- rename size to fltsize in _logsys_rec_init.

- document what we allocate and why.

- swap comments around to match the code.

- introduce a simple macro to perform rounding (stolen from linux-2.6.git).

- start shaping fdata header to better handle dynamic values:
  * write the flt_data_size as first unsigned int the header.
  * change corosync-fplay to read the value and alloc the right amount
    of memory instead of hardcoding it again.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2255 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 17:40:41 +00:00
Fabio M. Di Nitto
6d5ce092a1 logsys: port to new packed rec_ident version
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2250 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 05:32:56 +00:00
Fabio M. Di Nitto
5597a2381f logsys: merge tags into rec_ident
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2246 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 05:15:10 +00:00
Jan Friesse
c54e74e3f6 Make /etc/corosync/corosync.conf default configuration file
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2235 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-12 10:22:32 +00:00
Christine Caulfield
94e4234c99 Fix corosync-cfgtool -a so that it actaully produces some output!
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2227 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-10 07:33:19 +00:00
Christine Caulfield
3855b4285e Don't let corosync-keygen fail if /etc/ais already exists
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2207 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-04 16:12:08 +00:00
Jan Friesse
8605bbc7b2 Fix coroipcc linking
Fixes rhbz#499918
	
Functions from ckpt library (like aCkptCheckpointOpen,
saCkptSectionIterationInitialize, ...) internally uses corosync functions
reply_receive, reply_receive_in_buf, ... This functions are included in
coroipcc.c source file and uses global static variable ipc_hdb.

Without patch, coroipcc is linked to shared library (libcoroipcc.so) AND linked
with every corosync libraries (like cpg, ....), so global variable ipc_hdb is
included not only in libcoroipcc.so, but also in libcpg.so, ...

dlm_controld has function retrieve_plocks, and whole binary is linked with
libcoroipcc and libcpg. So ipc_hdb is included TWICE (so has TWO addresses).

Main problem causing the bug was, that reply_receive uses address from one
library, and reply_receive_in_buf uses other. This confuses check of hdb_get
function.

After removing linking of coroipcc.o to cpg, and rather use of dynamic version,
 (this means, there is only one instance of ipc_hdb) problem disappeared.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2203 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-01 08:46:10 +00:00
Jim Meyering
1f40a10983 don't include <signal.h> when it's not used
* exec/coroparse.c: Likewise.
* exec/quorum.c: Likewise.
* exec/sync.c: Likewise.
* exec/totemmrp.c: Likewise.
* exec/totemnet.c: Likewise.
* exec/totemrrp.c: Likewise.
* exec/totemsrp.c: Likewise.
* exec/vsf_quorum.c: Likewise.
* exec/vsf_ykd.c: Likewise.
* lcr/uic.c: Likewise.
* lcr/uis.c: Likewise.
* lib/cfg.c: Likewise.
* services/cfg.c: Likewise.
* services/cpg.c: Likewise.
* services/evs.c: Likewise.
* services/pload.c: Likewise.
* services/testquorum.c: Likewise.
* services/votequorum.c: Likewise.
* test/testconfdb.c: Likewise.
* test/testcpg.c: Likewise.
* test/testcpgzc.c: Likewise.
* test/testzcgc.c: Likewise.
* tools/corosync-cfgtool.c: Likewise.
* tools/corosync-objctl.c: Likewise.
* tools/corosync-pload.c: Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2193 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-18 16:41:46 +00:00
Jim Meyering
d44aad2eea don't include <assert.h> when it's not used
* exec/apidef.c: Likewise.
* exec/mainconfig.c: Likewise.
* exec/service.c: Likewise.
* exec/timer.c: Likewise.
* exec/totemconfig.c: Likewise.
* exec/totemmrp.c: Likewise.
* exec/vsf_quorum.c: Likewise.
* services/testquorum.c: Likewise.
* test/cpgbench.c: Likewise.
* test/cpgbenchzc.c: Likewise.
* tools/corosync-fplay.c: Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2192 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-18 16:41:37 +00:00
Fabio M. Di Nitto
75c9085204 Fix logsys TAG handling
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2180 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-13 03:59:47 +00:00
Christine Caulfield
e9660ee62f Add libnss security support to corosync.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2145 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-25 14:05:27 +00:00
Steven Dake
65f8490350 use uint64_t for hdb_handle_t type and also specify some formatting
strings for printing handles out of the handle database.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2126 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-23 10:03:01 +00:00
Jim Meyering
d86737ac9c remove empty lines at end-of-file
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2118 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-22 08:04:06 +00:00
Jim Meyering
904a10ed38 remove all trailing blanks
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2117 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-22 08:03:55 +00:00
Steven Dake
75c4bc0d71 Zero copy feature for IPC transmits. Also integrated into CPG library
service.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2114 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-21 23:37:49 +00:00
Jim Meyering
f5edd27d1d corosync-cfgtool.c: handle strdup failure gracefully
* tools/corosync-cfgtool.c (xstrdup): New function.
(main): Use it in place of strdup.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2100 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-20 18:26:22 +00:00
Steven Dake
221dddd0dd add schedwrk_create and schedwrk_destroy coroapi functions.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2089 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-18 14:39:57 +00:00