init: change return value when starting corosync

When corosync is started by systemd, it would be considered
as failed because it returns a non-zero value, even though it
starts sucessfully.

Signed-off-by: Lidong Zhong <lzhong@suse.com>
Signed-off-by: Xia Li<xli@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Install doc: Correct a typo

Signed-off-by: Konstantin <konstantin.ponomarenko@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
coroparse: More strict numbers parsing

Previous safe_atoi didn't check range of input values so if for example
user used -1 s token timeout, it was converted to UINT32_MAX without
letting user know.

Another safe_atoi problem was using strtol. This works pretty well on
64-bit systems, where long integer is usually 64-bits long, sadly on
32-bit systems, it is usually 32-bit long. And because strtol returns
signed integer, it was not possible to enter 32-bit value with highest
bit set.

Solution is to use strtoll which is guaranteed to be at least 64-bits
long and check value range.

Also error message now contains also information about expected value
range.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Doc: Enhance INSTALL file a bit

Some information in INSTALL file were pretty outdated. This patch moves
them closer to current release.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Make config.reload_in_progress key read only

It's not very good idea to allow user apps changing internal key
reload_in_progress.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
votequorum: Do not process events during reload

During reload, local_node_pos is deleted and reinstation is handled in
totemconfig after reload is finished. votequorum handles this events and
tries to reload it's configuration. This led to logging a little scary
messages (even nothing bad is happening, because after local_node_pos
reinstation everything back to normal).

Solution is to stop processing events during reload. Sadly, simple
tracking of config.reload_in_progress doesn't work because LibQB events
triggering order is undefined so votequorum reload handler can be called
before totemconfig (and before local_node_pos is reinstatied).

So new config.totemconfig_reload_in_progress key is defined with very
similar semanthic as config.reload_in_progress but set inside
totem_reload_notify function. Votequorum then use this new key.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
systemd: Config example for corosync wd service

Signed-off-by: Kazunori INOUE <kazunori.inoue3@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
fix memory leak produced by 'corosync -v'

Signed-off-by: zouyu <hopkings2005@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Handle SIGSEGV and SIGABRT signals

SIGSEGV and SIGABRT signals are now correctly handled (blackbox is
dumped and logsys is finalized).

Signed-off-by: zouyu <hopkings2005@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fix compiler warning introduced by previous patch

QB loop signal handler prototype differs from signal(2) prototype.
Solution is to create wrapper functions.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
corosync-cmapctl: Allow -p option to delete keys

Signed-off-by: Vladislav Bogdanov <bubble@hoster-ok.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Implement config file testing mode

Signed-off-by: Vladislav Bogdanov <bubble@hoster-ok.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
cleanup after test-driver

update .gitignore and make maintainer-clean target

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
be consistent in using CPPFLAGS vs CFLAGS

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

Allow it to create keyfile not in the hardcoded location.
Drop root checks.
Minor cosmetic fixes to the man-page.

Signed-off-by: Vladislav Bogdanov <bubble@hoster-ok.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
totemconfig: Free ifaddrs list

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

Add totem_config_get_ip_version to get user configured ip version.
Make totem_config_read use this newly introduced function.

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

Move finding of bindaddr in nodelist to generally usable function
totem_config_find_local_addr_in_nodelist and refactor
config_convert_nodelist_to_interface function to use it.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
corosync-keygen: Replace printf/exit call with err

Calling of err makes code shorter, easier to read and eliminates
problems with forgotten newline characters.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
config: Fix typos

Fix several places where 'then' is used instead of 'than' in error
messages and a comment.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>