Init script used to use corosync-cfgtool -s to wait till
corosync accepts ipc connection. Problem with this approach
is that error code is returned not only if ipc cannot be initialized,
but also when one of the ring is marked as failed, making corosync
service not to start. Corosync with one failed ring can work just
fine and there is no need to fail startup.
Patch is changing call of corosync-cfgtool to corosync-cpgtool. Also to
make spotting of broken ring easier, corosync-cfgtool -s is called after
successful return of the cpgtool, and warning is issued if cfgtool
fails.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
This reverts commit 03d9321bc8.
Reverted because when corosync service is not enabled and corosync
is executed by "systemctl start corosync" it is then immediately
shutdown because of "Unit not needed anymore. Stopping.".
This is really not expected behavior.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
It shall be a rule of thumb not to combine "application stack"
components run under particular init/supervision mechanism and
run by whatever other means (without transitive relationships
like when corosync's client runs from other pacemaker that is
itself started through systemd) when there's a directed graph
of reliance between them (sans constrained corner cases like
when of such components is a kernel module).
And corosync on its own is just a service provider that only
appears useful when utilized as a basic building block for
application specific distributed environments.
Therefore, we may assume whenever corosync gets started by the
means of systemd, it's because of a mechanized attempt to satisfy
declared dependency of some such corosync's client that is about
to be started under the service manager realms (directly or, by
induction, through the same triggering mechanism indirectly).
Hence, when there's no such client around anymore (unless
this dependant is being restarted at the moment, see below)
corosync shall rather shutdown as well.
In the past, there was an issue with systemd regarding said
inflicted restart of the dependant/client, but that's resolved
as of v236:
https://github.com/systemd/systemd/commit/
deb4e7080db9dcd2a1d51ccf7c357f88ea863e54
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
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>
Originating from a dual sink (stderr and syslog).
Annotated example from "journalctl -b --no-hostname -u corosync":
Aug 14 00:27:45 corosync[5203]: [MAIN ] Corosync Cluster
Engine ('2.99.3'): started and ready to provide service.
^ from syslog source
Aug 14 00:27:45 corosync[5203]: notice [MAIN ] Corosync Cluster
Engine ('2.99.3'): started and ready to provide service.
^ from stderr source
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Upstart files were already mostly removed but not from spec file and
configure.ac.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
corosync-qdevice and corosync-qnetd now has a new home
https://github.com/corosync/corosync-qdevice
This will allow us to better react on actual needs of quite independent
projects.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
When configured for systemd, don't install the SysV init scripts at all.
Signed-off-by: Ferenc Wágner <wferi@debian.org>
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Otherwise is just exits successfully (which should probably be fixed
eventually), leading to confusion.
Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This enables starting the daemon directly in the service file, because
dependent units won't be started until initialization is complete.
Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This reverts part of commit 32123f6bb2.
A simple directive is a much lighter solution to the same problem, and
automatically follows the specified User. I copied the 0770 modes from
the corresponding init scripts; they could use a little documentation.
Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This is a configure-time decision, avoid live filesystem checks.
Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Default value is /etc/sysconfig and resulting
INITCONFIGDIR is used to reduce duplication in init system
integration code.
Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Init script now checks return code of executing corosync command. If it
fails, ipc_wait section is skipped, resulting in much faster failure of
init script.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
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>
Init script loads /etc/sysconfig/corosync (or /etc/defaults/corosync) by
default, but it didn't existed by default and also no options was
defined.
Patch adds COROSYNC_INIT_TIMEOUT (how many seconds to wait for ipc
initialization) with default value 1 minute (instead of previous 10
seconds, what may be too small value for some productions) and
COROSYNC_OPTIONS (by default empty) containing options directly
passed to corosync executable.
Specfile template is also modified to install example of init file
configuration.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Change network.target to network-online.target to make sure network is
really up and running when starting corosync.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
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>
"sed -i" is a GNU specific extention.
Replace with more portable version and drop completely genman
in favour of a make rule.
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
- rename generic.in and notifyd.in to corosync.in and corosync-notifyd.in
(makes build simpler)
- fix sysvinit corosync.in sleep time to include a check for when IPC
are ready and drop cman bits (there is no cman with corosync 2.0)
- corosync-notifyd.service should always start after corosync.service
- corosync.service should always start after network
- corosync.service uses init script wrapper
- install/ship sysvinit as wrappers for systemd in /usr/share/corosync
when necessary
- change the build system to deal with all of the above
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
this solves the issue of having to special case before and after usrmove
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Without wait for real exit of corosync-notifyd it can happen, that new
corosync-notifyd is killed. To prevent such condition, stop now wait for
process to die, before exit of stop function.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
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>
Init script checks kernel parameters and refuses to start corosync if
nocluster parameter exist on boot time. The init script will
continue to work as expected from console/tty after boot.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>