]> git.proxmox.com Git - mirror_corosync-qdevice.git/log
mirror_corosync-qdevice.git
3 years agoqdevice: Fix connect heuristics result callback
Jan Friesse [Wed, 12 Aug 2020 13:42:12 +0000 (15:42 +0200)]
qdevice: Fix connect heuristics result callback

Qdevice may crash if server disconnect before connect
heuristics callback is processed.

This is quite hard to reproduce without adding sleep before
qdevice_net_heuristics_exec_after_connect call.

Solution is to check if qdevice is still connected and if it doesn't,
just throw away connect heuristics results.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
3 years agoqdevice: Add space before bracket
Jan Friesse [Wed, 12 Aug 2020 13:32:17 +0000 (15:32 +0200)]
qdevice: Add space before bracket

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
3 years agoqdevice: Use EXIT_SUCCESS and EXIT_FAILURE codes
Jan Friesse [Wed, 12 Aug 2020 13:31:33 +0000 (15:31 +0200)]
qdevice: Use EXIT_SUCCESS and EXIT_FAILURE codes

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
3 years agoqnetd: Do not call ffsplit_do on shutdown
Jan Friesse [Wed, 12 Aug 2020 12:36:59 +0000 (14:36 +0200)]
qnetd: Do not call ffsplit_do on shutdown

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
3 years agoqnetd: Migrate main loop to pr-poll-loop
Jan Friesse [Wed, 12 Aug 2020 12:36:24 +0000 (14:36 +0200)]
qnetd: Migrate main loop to pr-poll-loop

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
3 years agopr-poll-loop: Add main poll loop based on PR_Poll
Jan Friesse [Wed, 12 Aug 2020 12:32:33 +0000 (14:32 +0200)]
pr-poll-loop: Add main poll loop based on PR_Poll

Add main loop abstraction based on PR_Poll with set_events, read, write
and error callbacks.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
3 years agoconfigure: Use default systemd path with prefix
Jan Friesse [Tue, 14 Jul 2020 14:29:08 +0000 (16:29 +0200)]
configure: Use default systemd path with prefix

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
3 years agobuild: Use git-version-gen during specfile build
Jan Friesse [Tue, 14 Jul 2020 13:38:12 +0000 (15:38 +0200)]
build: Use git-version-gen during specfile build

Instead of copying parts of git-version-gen for spec target use
git-version-gen directly and parse final version into components
(rpmver, alphatag, numcomm) and use them.

Main reason is to simplify code a bit (sed scripts are a bit repetitive
tho), reuse the code and also allow building of RPM from dist tarball
generated from non-tagged commit or dirty git (not very useful).

The code relies on fact, that hyphen is never used in tagged release
name.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
3 years agobuild: Update git-version-gen
Jan Friesse [Tue, 14 Jul 2020 13:22:55 +0000 (15:22 +0200)]
build: Update git-version-gen

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoqdevice: Change log level to NOTICE on PASS
liangxin1300 [Thu, 12 Mar 2020 16:35:58 +0000 (00:35 +0800)]
qdevice: Change log level to NOTICE on PASS

Previously when heuristics result became PASS it was logged as an error.
It shouldn't be and error message so change it to LOG_NOTICE level.

Signed-off-by: liangxin1300 <XLiang@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Add prototype of __vsyslog_chk
Jan Friesse [Wed, 27 Nov 2019 13:43:22 +0000 (14:43 +0100)]
qdevice: Add prototype of __vsyslog_chk

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoinit: change restart to on-failure for qdevice
Kumabuchi Kenji [Tue, 10 Sep 2019 13:44:07 +0000 (22:44 +0900)]
init: change restart to on-failure for qdevice

Signed-off-by: Kumabuchi Kenji <k.kumabuchi+curvygrin@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Add chk variant of vsyslog to test-log
Jan Friesse [Wed, 14 Aug 2019 07:58:48 +0000 (09:58 +0200)]
qdevice: Add chk variant of vsyslog to test-log

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Add header files to list of test sources
Jan Friesse [Tue, 13 Aug 2019 14:00:28 +0000 (16:00 +0200)]
qdevice: Add header files to list of test sources

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Add log test
Jan Friesse [Tue, 13 Aug 2019 13:57:09 +0000 (15:57 +0200)]
qdevice: Add log test

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Free memory used by log
Jan Friesse [Tue, 13 Aug 2019 13:55:05 +0000 (15:55 +0200)]
qdevice: Free memory used by log

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agotests: Add utils_parse_bool_str test
Jan Friesse [Tue, 13 Aug 2019 13:11:57 +0000 (15:11 +0200)]
tests: Add utils_parse_bool_str test

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Configurable log priority bump
Jan Friesse [Mon, 12 Aug 2019 15:43:51 +0000 (17:43 +0200)]
qdevice: Configurable log priority bump

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqnetd: Use log-common for nodelist debug dump
Jan Friesse [Mon, 12 Aug 2019 14:52:18 +0000 (16:52 +0200)]
qnetd: Use log-common for nodelist debug dump

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Merge msg_decode_error functions
Jan Friesse [Mon, 12 Aug 2019 14:45:31 +0000 (16:45 +0200)]
qdevice: Merge msg_decode_error functions

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Import log instead of qdevice-log
Jan Friesse [Mon, 12 Aug 2019 14:33:30 +0000 (16:33 +0200)]
qdevice: Import log instead of qdevice-log

and move qdevice-log-debug to log-common to share it with qnetd.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Use log instead of libqb log
Jan Friesse [Mon, 12 Aug 2019 13:20:09 +0000 (15:20 +0200)]
qdevice: Use log instead of libqb log

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqnetd: Add function to set log target
Jan Friesse [Mon, 12 Aug 2019 12:04:04 +0000 (14:04 +0200)]
qnetd: Add function to set log target

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqnetd: Check log initialization error
Jan Friesse [Mon, 12 Aug 2019 11:31:13 +0000 (13:31 +0200)]
qnetd: Check log initialization error

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqnetd: Fix double -d description
Jan Friesse [Mon, 12 Aug 2019 11:30:53 +0000 (13:30 +0200)]
qnetd: Fix double -d description

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqnetd: Rename qnetd-log.c to log.c
Jan Friesse [Mon, 12 Aug 2019 11:19:02 +0000 (13:19 +0200)]
qnetd: Rename qnetd-log.c to log.c

And remove qnetd_ prefix from function names.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoqdevice: Fix qdevice_heuristics_destroy error
Jan Friesse [Mon, 10 Jun 2019 09:11:54 +0000 (11:11 +0200)]
qdevice: Fix qdevice_heuristics_destroy error

When daemonization is used, heuristics worker is not a child of
the corosync-qdevice process any longer so it's not possible
to wait for its exit.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoconfigure: Add user-flags configure option
Jan Friesse [Mon, 10 Jun 2019 08:25:42 +0000 (10:25 +0200)]
configure: Add user-flags configure option

configure.ac adds by optimization and debug flags by default. This is
not always intended so conifgure option is added.

Support for using this option in specfile is added too.

Also fix GDB_CFLAGS typo. GDB_FLAGS (without C)
is the correct name of variable to print in the summary.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoman: Fix corosync-qdevice default connect_timeout
Jan Friesse [Thu, 25 Apr 2019 17:01:51 +0000 (19:01 +0200)]
man: Fix corosync-qdevice default connect_timeout

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agospec: Use install -p and add license
Jan Friesse [Wed, 20 Mar 2019 17:11:06 +0000 (18:11 +0100)]
spec: Use install -p and add license

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoqnetd: Check existence of NSS DB dir before fork
Jan Friesse [Tue, 19 Mar 2019 14:16:11 +0000 (15:16 +0100)]
qnetd: Check existence of NSS DB dir before fork

Previously, when user tried start corosync-qnetd without
initialized NSS database then generic (not very helpful
and misleading) NSS error was logged
"NSS error (-8015): The certificate/key database is in an old,
unsupported format.".

Solution is to check if it's possible to open NSS DB directory and
display (usually much more informative) result of strerror function.

Such check is called before fork, so init system can return error code
during start.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
5 years agocertutils: Fix warnings found by coverity
Jan Friesse [Mon, 26 Nov 2018 13:03:32 +0000 (14:03 +0100)]
certutils: Fix warnings found by coverity

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoinit: Fix init scripts to work with containers
Jan Friesse [Wed, 14 Nov 2018 16:52:11 +0000 (17:52 +0100)]
init: Fix init scripts to work with containers

Previously init scripts were not using pid file so pidof was used. This
is usually not a problem, but when containers are used it may result to
killing improper instance when issued on host.

Solution is to always use pidfile.

Also try to use LSB complaint status codes.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
5 years agoconfigure: move to AC_COMPILE_IFELSE
Jan Friesse [Wed, 7 Nov 2018 14:16:13 +0000 (09:16 -0500)]
configure: move to AC_COMPILE_IFELSE

from AC_PREPROC_IFELSE which is strongly discouraged.

Our detection system was very weak and recent versions of clang did
show that PREPROC_IFELFE (cpp) would enable warning options that
the compiler does not support (clang).

Use a full compilation test to detect what works and what doesn't.

Based on knet patch 88491f27375a9e8aceb946853a1abf4d23ebb8f3.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years agogit-version-gen: Fail on UNKNOWN version
Jan Friesse [Fri, 31 Aug 2018 12:52:24 +0000 (14:52 +0200)]
git-version-gen: Fail on UNKNOWN version

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
5 years agobuild: Support for git archive stored tags
Jan Friesse [Mon, 3 Sep 2018 15:01:21 +0000 (17:01 +0200)]
build: Support for git archive stored tags

Attempt to solve problem with git archive generated tarballs
(used for example by github when release is downloaded) which are no
longer git tree and (in contrast to officially released tarballs) also
doesn't contain .tarball-version file so git-version-gen script simply
cannot obtain valid version info.

Solution is based on using gitattributes which is instructs git to
replace string in the .gitarchivever file by known ref names.
git-version-gen is enhanced to support this file and tries to parse
any string which looks like "tag: v[0-9]+.[0-9]+.[0-9]". If such string
is found it's used as a version. This file is used as a last attempt and
other methods (.tarball-version, git abbrev) have precedence.

Based on idea stated by Jan Pokorný <jpokorny@redhat.com>.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
5 years agoqdevice: Propagate error to exit code
Jan Friesse [Mon, 27 Aug 2018 15:07:53 +0000 (17:07 +0200)]
qdevice: Propagate error to exit code

Net model never returned error when qdevice_model_run was called. This
was incorrect because with exception of local ipc close all other
disconnect reasons are errors.

Solution is to return proper error code.

Also instead of exit right after qdevice_model_run it's better to store
result value, try clean resources and use stored value to return correct
exit code.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agobuild: Remove WITH_LIST
Jan Friesse [Wed, 22 Aug 2018 12:19:32 +0000 (14:19 +0200)]
build: Remove WITH_LIST

WITH_LIST is replaced in favor of bcond generator.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agospec: Autogenerate bcond options based on config
Jan Friesse [Wed, 22 Aug 2018 11:11:00 +0000 (13:11 +0200)]
spec: Autogenerate bcond options based on config

Inspired by kronosnet spec file generator.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agospec: add exlicit docdir
Jan Friesse [Tue, 21 Aug 2018 15:07:53 +0000 (17:07 +0200)]
spec: add exlicit docdir

OpenSUSE does not ship docs in the normal dir and their rpm macro
does not appear to set it for us.

Based on corosync 30c7f3319f003efa1abeb2173eef9e5c7943ae5b.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agospec: Use different BuildRequires for SUSE
Jan Friesse [Tue, 21 Aug 2018 13:19:10 +0000 (15:19 +0200)]
spec: Use different BuildRequires for SUSE

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoinit: disable stderr output in systemd unit file
Jan Friesse [Tue, 21 Aug 2018 08:01:26 +0000 (10:01 +0200)]
init: disable stderr output in systemd unit file

Usually both syslog and stderr are enabled so log entries are duplicated
in journal. Solution is to use similar patch as corosync
c34208ad402b45f52b5d3ee8d2a08df0779ec9aa and disable stderr.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agotests: Enlarge timeout for process-list test
Jan Friesse [Tue, 21 Aug 2018 07:18:58 +0000 (09:18 +0200)]
tests: Enlarge timeout for process-list test

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agospec: Add explicit gcc build dependency
Jan Friesse [Thu, 9 Aug 2018 13:52:51 +0000 (15:52 +0200)]
spec: Add explicit gcc build dependency

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoconfig: Remove unneeded qb includes
Jan Friesse [Thu, 9 Aug 2018 13:35:24 +0000 (15:35 +0200)]
config: Remove unneeded qb includes

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoqnetd-certutil: Add -G option
Jan Friesse [Thu, 9 Aug 2018 12:55:36 +0000 (08:55 -0400)]
qnetd-certutil: Add -G option

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoman: Document NSS database conversion
Jan Friesse [Thu, 9 Aug 2018 11:57:04 +0000 (07:57 -0400)]
man: Document NSS database conversion

This is not needed at least for cert8 -> cert9, but it's still nice to
have it documented. Also document NSS_IGNORE_SYSTEM_POLICY=1 workaround.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoqdevice-net-certutil: Implement scp wrapper
Jan Friesse [Wed, 8 Aug 2018 13:20:02 +0000 (09:20 -0400)]
qdevice-net-certutil: Implement scp wrapper

Standard scp doesn't handle copy of file from remote machine to remote
machine very well when agent forwarding is used and no key exists
between the machines.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agocertutil: Add support for new NSS database format
Jan Friesse [Wed, 8 Aug 2018 12:48:02 +0000 (08:48 -0400)]
certutil: Add support for new NSS database format

New NSS database uses files cert9.db, key4.db and pkcs11.txt. Add
support for these files into cert utilities.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agogitignore: Add testsuite results
Jan Friesse [Wed, 8 Aug 2018 11:53:52 +0000 (07:53 -0400)]
gitignore: Add testsuite results

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agoqdevice-cmap: Fix compiler warning on Sparc/ARM
Jan Friesse [Wed, 8 Aug 2018 10:41:20 +0000 (12:41 +0200)]
qdevice-cmap: Fix compiler warning on Sparc/ARM

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
5 years agotests: Notify process-list after trap was created
Jan Friesse [Wed, 8 Aug 2018 06:04:22 +0000 (08:04 +0200)]
tests: Notify process-list after trap was created

Previously there was no waiting for establish of bash trap.
This may result in situation when sigint/term was send before trap
making test fail.

Solution is to catch the sigusr1 and sigusr2 signals in tests and wait
till these signals are sent by bash after trap is established.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agounix-socket: Fix snprintf warning
Jan Friesse [Wed, 2 May 2018 13:16:03 +0000 (15:16 +0200)]
unix-socket: Fix snprintf warning

Base N on sizeof sun_path instead of strlen of input path.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agotests: enlarge process-list timeouts
Jan Friesse [Fri, 27 Apr 2018 13:34:00 +0000 (15:34 +0200)]
tests: enlarge process-list timeouts

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agotests: process-list add stdlib include
Jan Friesse [Fri, 27 Apr 2018 09:10:46 +0000 (11:10 +0200)]
tests: process-list add stdlib include

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agotests: Fix process-list test to work on FreeBSD
Jan Friesse [Fri, 27 Apr 2018 09:03:20 +0000 (11:03 +0200)]
tests: Fix process-list test to work on FreeBSD

FreeBSD true and false commands are installed in the /usr/bin prefix
instead of Linux /bin.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoFix typo: sucesfully -> successfully
Ferenc Wágner [Tue, 10 Apr 2018 10:47:49 +0000 (12:47 +0200)]
Fix typo: sucesfully -> successfully

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoqdevice: optarg should be str in init_from_cmap
Bin Liu [Thu, 19 Apr 2018 08:52:27 +0000 (16:52 +0800)]
qdevice: optarg should be str in init_from_cmap

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agospec: Remove unused clean section
Jan Friesse [Thu, 12 Apr 2018 14:10:41 +0000 (16:10 +0200)]
spec: Remove unused clean section

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agomsgio: Remove unused code
Jan Friesse [Tue, 3 Apr 2018 06:58:46 +0000 (08:58 +0200)]
msgio: Remove unused code

Blocking version of send was used in the very early phases of qdevice
development and it's not used any longer, so it make sense to delete
it.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agomsgio: Fix reading of msg longer than PR_INT32_MAX
Jan Friesse [Fri, 23 Mar 2018 16:19:09 +0000 (17:19 +0100)]
msgio: Fix reading of msg longer than PR_INT32_MAX

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoqnetd: Replace strtol by strtonum
Jan Friesse [Fri, 2 Mar 2018 12:31:47 +0000 (13:31 +0100)]
qnetd: Replace strtol by strtonum

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoqdevice: Replace strtol by strtonum
Jan Friesse [Fri, 2 Mar 2018 12:31:19 +0000 (13:31 +0100)]
qdevice: Replace strtol by strtonum

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoAdd safer wrapper of strtoll
Jan Friesse [Wed, 28 Feb 2018 15:34:48 +0000 (16:34 +0100)]
Add safer wrapper of strtoll

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoCheck if user_data can be dereferenced
Jan Friesse [Wed, 3 Jan 2018 15:51:11 +0000 (16:51 +0100)]
Check if user_data can be dereferenced

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoNodelist is set into string not array
Jan Friesse [Wed, 3 Jan 2018 15:12:58 +0000 (16:12 +0100)]
Nodelist is set into string not array

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoFix NULL pointer dereference
Jan Friesse [Wed, 3 Jan 2018 13:52:30 +0000 (14:52 +0100)]
Fix NULL pointer dereference

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoQuote certutils scripts properly
Jan Friesse [Tue, 2 Jan 2018 17:02:35 +0000 (18:02 +0100)]
Quote certutils scripts properly

Also remove unused variables.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoinit: Quote subshell result properly
Jan Friesse [Wed, 28 Feb 2018 15:27:08 +0000 (16:27 +0100)]
init: Quote subshell result properly

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agospec: Modernize spec file a bit
Jan Friesse [Thu, 25 Jan 2018 09:32:42 +0000 (10:32 +0100)]
spec: Modernize spec file a bit

Thanks to Robert-André Mauchin <zebob.m@gmail.com> for spec file review
and comments.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoInitial import from corosync codebase
Jan Friesse [Mon, 22 Jan 2018 14:59:23 +0000 (15:59 +0100)]
Initial import from corosync codebase

Used the code from corosync master
(31ddba64a2726bcedf81eb84df2e2da4846832f7)

Signed-off-by: Jan Friesse <jfriesse@redhat.com>